Module 1: Overview of XML Documents

50 431 0
Module 1: Overview of XML Documents

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Module 1: Overview of XML Documents Contents Overview Structuring Data What is XML? 10 Creating XML Documents 19 Grammars and Namespaces 36 Demonstration: The LitWare Books Application 42 Review 43 Information in this document is subject to change without notice The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted Complying with all applicable copyright laws is the responsibility of the user No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation If, however, your only means of access is electronic, permission to print one copy is hereby granted Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property  2000 Microsoft Corporation All rights reserved Microsoft, PowerPoint, Visual Interdev, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted Other product and company names mentioned herein may be the trademarks of their respective owners Program Manager: Steve Merrill Instructional Designers: Sangeeta Nair (NIIT), Vijayalakshmi Narayanaswamy (NIIT) Subject Matter Experts: Andy Olsen (QA Training), Andy Longshaw (Content Masters) Content Lead: Janet Robinson Graphic Artist: Scott Serna (Creative Assets) Media Management: David Mahlmann Media Production: Dean Connolly (Art Source), Timothy Demmon (:timebomb Media) Editing Manager: Jennifer Linn Editor: Dennis Rae (Wasser) Production Manager: Miracle Davis Print Coordinator: Marlene Lambert (Online Training Solutions, Inc) Build Manager: Julie Challenger Build Coordinator: Jenny Boe Test Lead: Eric Myers Manufacturing Manager: John Williams Group Product Manager: Steve Elston Module 1: Overview of XML Documents iii Instructor Notes Presentation: 120 Minutes Lab: 00 Minutes This module provides students with an introduction to XML The module describes some of the problems currently facing organizations that need to store data and interchange it between applications, and then shows the syntax for an XML document By the end of this module, students should appreciate the problems that XML solves, and be comfortable with the syntax for elements, attributes, and namespaces in a static XML document Students should also be aware of the standardization process overseen by the World Wide Web Consortium (W3C), and be made aware of Microsoft’s position with regard to these standards After completing this module, students will be able to: ! List the uses for XML on a Web site ! List advantages and disadvantages of using XML ! Describe the structure of an XML document ! Create a simple XML document ! List some of the issues associated with designing XML documents Materials and Preparation This section provides you with the required materials and preparation tasks that you need to teach this module Required Materials To teach this module, you need the following materials: ! Microsoft PowerPoint® file 1905a_01.ppt ! Module 1, “Overview of XML Documents” Preparation Tasks To prepare for this module, you should: ! Read all of the materials for this module ! Study the LitWare Books lab solution Students complete this lab during the course The lab solution is introduced in this module to set the scene for the rest of the course ! Visit the W3C Web site at http://www.w3.org and the OASIS Web site at http://www.oasis-open.org/cover to familiarize yourself with the layout and scope of these Web sites ! Visit Microsoft’s XML Web site at http://msdn.microsoft.com/xml to familiarize yourself with its layout and scope iv Module 1: Overview of XML Documents Demonstration This section provides demonstration procedures that will not fit in the margin notes or are not appropriate for the student notes Demonstration: Creating and viewing an XML document ! To run this demonstration In Notepad, open the file Employees.xml from the folder \InetPub\WWWRoot\1905\DemoCode\Mod01 Describe the syntax of the document Launch Microsoft Internet Explorer and open Employees.xml Show that you can collapse and expand the nodes of the tree in Internet Explorer Make some errors in Employees.xml, such as changing the capitalization of an element or deleting a closing tag, and redisplay the file in Internet Explorer to show how the browser handles documents that are not well formed In Internet Explorer 5, open the file Macbeth.xml from the folder \InetPub\WWWRoot\1905\DemoCode\Mod01 Describe the elements in the document and explain why XML is well suited for representing structured data such as the entire contents of Shakespeare’s play Macbeth For example, with the data in XML, you could easily add lighting instructions for a stage performance of the play In Internet Explorer 5, open the file WeatherReport.xml from the folder \InetPub\WWWRoot\1905\DemoCode\Mod01 and point out that the document uses a mixture of elements and attributes Do not talk about the design issues around using attributes or child elements just yet Demonstration: The LitWare Books application In this demonstration, describe the functionality of the LitWare Books application and the technologies that are used for each step ! To run this demonstration Launch Internet Explorer and enter the URL for the LitWare Books solution Web site, http://localhost/LitwareSolution In this application, the user looks for books, places selected books into a client-side XML shopping basket, and then posts the XML to the server to order the books On the home page, enter Lars% in the query by author field, and then click Query QueryInput.htm posts a query to the ASP page Query.asp, which executes an ADO query and returns matching books as XML, with an attached XSL style sheet, QueryResult.xsl Module 1: Overview of XML Documents Click one of the Details links The link passes ISBN information to the ASP page Details.asp The server executes another ADO query and returns an HTML document containing an XML data island with the book details The HTML document uses data binding to display the information Enter a number in the quantity text field, and then click Add to Basket Details.asp uses client-side DOM script to transform the book information, using TransformBookDetails.xsl, into a format expected by the server, and then adds the transformed data to a client-side XML data island stored in default.htm Click View Order ViewOrder.htm uses client-side DOM script to traverse the client-side data island and build an HTML string describing the shopping basket contents Click Go to Checkout Enter customer number 1, and then click Submit Order Checkout.htm posts the XML shopping basket data to the ASP page CustomerOrder.asp The server validates the data with the schema CustomerOrderSchema.xml, enters the order information into the database, and then returns a confirmation message to the client Other Activities This section provides procedures for implementing interactive activities to present or review information, such as games or role-playing exercises Practice: Creating an XML document Have students work on their own to create a well-formed XML document describing an airline ticket Then display a couple of different documents and talk about the different elements and attributes used in each The following is one solution to the practice exercise: Sue Jackson 112890FN SEATAC LAX v vi Module 1: Overview of XML Documents Module Strategy Use the following strategies to present this module: ! Structuring Data The purpose of this section is to present a backdrop for XML Describe the problems currently facing information processing so that students appreciate the need for XML The key point to stress is that data is meaningless unless you know the context of the data, and XML offers a way of providing that context ! What is XML? In this section, you will introduce how XML is used on the Web and compare it with HTML Most students will have seen some HTML before, so you can simply emphasize the differences between XML and HTML syntax Make sure that students realize the different purposes of XML and HTML — HTML defines how to present data, but XML defines the meaning of the data XML is not replacing HTML Discuss the benefits to the server in delivering XML rather than HTML The server can send the same XML file to any browser, rather than generating a different version of HTML for each browser Also discuss the benefits to the browser in retrieving XML The client can perform local filtering, reordering, changing display formats, and so on without involving the server ! Creating XML Documents This section introduces the basic syntax for XML elements and attributes and the difference between a well-formed and a valid XML document Discuss the overall format of an XML document Emphasize the XML declaration and the fact that a document can only have a single root element Do not go into too much detail on DTDs yet — they are discussed in Module 2: Overview of XML Technologies Don’t go into too much detail about Microsoft’s toolset for XML Many of these tools are covered later in the course In the practice, students are asked to design their own XML documents After completion, compare various solutions to see how different they are Finally, describe some of the reasons for choosing between elements and attributes in an XML document Don’t allow students to get too bogged down in this discussion, as there are no tried and true guidelines available yet ! Grammars and Namespaces Discuss the benefits of having “standard” grammars for particular business sectors For some examples, you can visit http://www.oasis-open.org/cover and navigate to the XML Applications page, where a large number of existing grammars are described Ask students what problems might arise if two companies decide to define their own grammars For example, there is the possibility of name clashes Describe namespaces as a way of resolving these clashes Discuss qualified namespaces first (that is, with a namespace prefix), then discuss default namespaces (that is, no namespace prefix) Module 1: Overview of XML Documents # Overview Slide Objective To provide an overview of the module topics and objectives ! Structuring Data Lead-in ! What is XML? ! Creating XML Documents ! Grammars and Namespaces ! Demonstration: The LitWare Books Application ! Review This module introduces the need for XML in ecommerce, and shows how to create simple XML documents The module also looks at some of the available tools and discusses current trends in the XML community Delivery Tip There are no labs in this module, only practices This module provides an overview of the Extensible Markup Language, or XML You will learn about the need for XML documents in e-commerce and Information Technology, and see how to create a simple XML document containing a few basic elements and attributes XML is an evolving standard governed by the Worldwide Web Consortium (W3C) This module describes the current state of the technology and highlights some of the industry initiatives that are helping to take XML forward into the future After completing this module, you will be able to: ! List the uses for XML on a Web site ! List advantages and disadvantages of using XML ! Describe the structure of an XML document ! Create a simple XML document ! List some of the issues associated with designing XML documents Module 1: Overview of XML Documents # Structuring Data Slide Objective To provide an overview of the topics in this section Lead-in This section explains the problems inherent in exchanging information between different Web applications, and how XML overcomes these problems ! Structured vs Unstructured Data ! Problems with Information Processing ! Searching Data ! The Need for XML ! Describing Data with XML Tags The growth and power of the Web lies in its ability to let us communicate with anyone, anywhere This became possible only through standard technologies such as Internet Protocol (IP), Hypertext Transport Protocol (HTTP), and Hypertext Markup Language (HTML), all of which are platform-independent However, today we use the Web primarily as a medium to access and display information in the form of text and graphics The Internet must expand its role to link applications across the entire Web in such a way that any application anywhere can communicate with any other application or set of data This is the key to making the Web the backbone for business-to-business and organizationto-organization communication For example, the Internet should allow the exchange of electronic payment information, or of patient medical data and prescriptions between doctors and pharmacists Today, HTML is widely used as the vehicle for exchanging information on the Web There is no doubt that HTML is very good as a presentation language, but it is not suitable for representing data For example, you can easily format data in an HTML table, but you cannot describe the individual components of the information To share information between applications, you must have a language that can describe data in a standard way so that any application, present or future, can understand and use this data correctly In this section, you will learn about the problems inherent in handling unstructured data, and how XML helps you structure your data Module 1: Overview of XML Documents Structured vs Unstructured Data Slide Objective To explain the need for structured data Lead-in ! Much of the information we use every day makes sense only because we know the context of its usage Data without context is meaningless and open to misinterpretation ???????? 4.00 ! Structured data allows other applications to understand and use the data ! Data that describes data is known as metadata Data is useful only if its context is understood For example, if the price of an item is “4,” this data is useless unless one knows that the price is expressed in dollars or some other currency Typically, application programs that manipulate data contain business rules that define the context of the data However, when data is exchanged between applications, there is always the threat of its being misinterpreted Such problems can be handled to a certain extent within an organization through the use of data dictionaries and other standards However, with the advent of the Internet, there is a growing need for information to be shared electronically between organizations To facilitate an open exchange of data, you must first define the structure of the data in detail and then expose it to other applications The term “metadata” means data about data Metadata provides a context for data that is shared between applications, thus enabling these applications to interpret the data meaningfully Module 1: Overview of XML Documents Problems with Information Processing Slide Objective To explain the problems faced in processing information ! Creating and distributing valuable document information ! Generating multiple output formats ! Integrating multiple sources of information ! Managing conditional information Lead-in Organizations and businesses face many challenges in dealing with information When it comes to processing and delivering information, most organizations and businesses typically face the following problems: ! Creating and distributing valuable document information Organizations that distribute information of great value include publishers of technical, medical, legal, or business data, and manufacturers of complex products whose operating and service manuals are vital companions to the products themselves These organizations invest heavily in the creation and distribution of information that their customers consider crucial As a result, the organizations gain maximum benefit from methods that increase the accuracy, timeliness, and flexibility of their information while reducing production and maintenance costs ! Generating multiple output formats There is a growing need for a format-independent method of generating multiple outputs such as printed documentation, update bulletins, CD-ROM distribution, online (Internet) delivery, on-demand printing, Help files, and machine-readable data ! Integrating information from multiple sources When information must be collected from multiple sources, the effort invested in integrating this information is substantially reduced if all sources use a common formatting method agreed upon within a common-interest community, rather than multiple varied formats Delivery Tip Separates content of data from display of data ! Managing conditional information If the information in a document varies depending on external factors, such as service instructions that vary according to the weather, we need a way of identifying the information that is dependent on these external factors There must be a means of managing this conditional operation so that the appropriate document contents are produced in all circumstances ... disadvantages of using XML ! Describe the structure of an XML document ! Create a simple XML document ! List some of the issues associated with designing XML documents 2 Module 1: Overview of XML Documents. .. compares XML with HTML documents ! History of XML and W3C ! XML and the Web ! XML vs HTML ! Advantages and Disadvantages of XML ! Uses of XML In this section, you will learn about the background of XML, ... producing text documents, with embedded tags to define the structure of the data XML is extensible because the set of tags supported in XML is open-ended Module 1: Overview of XML Documents Describing

Ngày đăng: 22/10/2013, 16:15

Tài liệu cùng người dùng

Tài liệu liên quan