1. Trang chủ
  2. » Công Nghệ Thông Tin

Module 2: Overview of XML Technologies

50 357 0
Tài liệu đã được kiểm tra trùng lặp

Đ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

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 0,99 MB

Nội dung

Contents Overview 1 XML Technologies: The Big Picture 2 Viewing XML with Style Sheets 7 Binding XML to HTML 17 Accessing XML with the Document Object Model 25 Validating XML 32 Review 43 Module 2: Overview of XML Technologies 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, ActiveX, PowerPoint, Visual C++, Windows, and Windows NT 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 2: Overview of XML Technologies iii Instructor Notes This module provides students with an overview of the principal technologies associated with XML. The aim is to provide students with the big picture so that they realize how all the pieces of the XML jigsaw fit together. Apart from cascading style sheets (CSS) and Document Type Definitions (DTDs), all the topics introduced in this module are revisited in greater depth in subsequent modules. Therefore, there is no need to discuss topics exhaustively here. All that students need at the moment is an appreciation of what’s possible, and an awareness of some of the terminology such as style sheets, data binding, DOM, and validation. After completing this module, students will be able to: ! Explain the use of style sheets. ! Explain the use of binding XML data to HTML. ! Describe the Document Object Model (DOM). ! Explain the need for validation. ! Describe the differences between DTDs and XML schemas. 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_02.ppt ! Module 2, “Overview of XML Technologies” ! Animation, “Life Cycle of an XML Document,” in file 1905a_02A005.avi Preparation Tasks To prepare for this module, you should: ! Read all of the materials for this module. Presentation: 180 Minutes Lab: 00 Minutes iv Module 2: Overview of XML Technologies Module Strategy Use the following strategies to present this module: ! XML Technologies: The Big Picture The purpose of this section is to introduce some XML terminologies — style sheets, data binding, the Document Object Model (DOM), and validation. There is an animation that shows simplified examples of each topic; all you need to do is briefly introduce the terms before you play the animation. ! Viewing XML with Style Sheets Begin by introducing cascading style sheets (CSS) as they relate to HTML. (Some students may already be familiar with this.) Describe how CSS style sheets can be applied to XML documents in a similar manner, but make it clear that we are only providing a simple overview of CSS here. Emphasize the limitations of CSS (for example, it doesn’t allow data filtering, reordering, or scripting). Introduce the Extensible Stylesheet Language (XSL) and show the effect of applying different style sheets to an XML document. Do not attempt to describe XSL syntax yet; instead, refer students to Module 4: Displaying an XML Document Using XSL. ! Binding XML to HTML Discuss the different ways in which a Web server can return information to the browser: HTML, XML, or a combination of both. Then discuss the disadvantages of the first two methods: HTML is portable but doesn’t allow the client to manipulate the data intelligently; XML allows the client to process the data, but provides limited means of scripting. Introduce XML data islands as a solution that combines the benefits of HTML and XML. Then briefly discuss data binding at a conceptual level. Do not go into the detail; instead, refer students to Module 5: Embedding XML Data in HTML. ! Accessing XML with the Document Object Model DOM is a broad subject. All students need to know at the moment is that it is a programming interface to XML data. Use the opportunity to describe how XML documents are read into an in-memory tree during parsing. Also, compare DOM with other object models that students might be familiar with (for example, Microsoft Excel, ActiveX Data Objects). In the demonstration, do not dwell on the script that uses the DOM. Just discuss the example at a conceptual level and show the effects of running the example in the browser. For more details about DOM, refer students to Module 6: Manipulating XML Data on the Client Using DOM. ! Validating XML This section contains three main themes: to describe what validation is and why it’s needed, to provide a brief overview of DTDs, and to introduce XML schemas as the preferred validation technique. Module 2: Overview of XML Technologies v This is the only place in the course where DTDs are discussed, but they are covered only briefly. Be careful not to dismiss DTDs as irrelevant because they are used widely in the XML community even now. However, you also need to make students understand why we are concentrating on XML schemas (for example, technical advantages, the BizTalk factor, and Microsoft’s commitment to XML schemas). For more details about XML schemas, refer students to Module 8: Validating XML Data Using Schemas. Module 2: Overview of XML Technologies 1 # ## # Overview ! XML Technologies: The Big Picture ! Viewing XML with Style Sheets ! Binding XML to HTML ! Accessing XML with the Document Object Model ! Validating XML ! Review In this module, you will learn about some of the supporting technologies that allow XML documents to be displayed, manipulated in programs, and validated for correct structure. After completing this module, you will be able to: ! Explain the use of style sheets. ! Explain the use of data binding XML data to HTML. ! Describe the Document Object Model (DOM). ! Explain the need for validation. ! Describe the differences between DTDs and XML schemas. Slide Objective To provide an overview of the module topics and objectives. Lead-in In this module, you will learn about some of the XML technologies currently in use. Delivery Tip This is the only section in the entire course in which DTDs will be covered. 2 Module 2: Overview of XML Technologies # ## # XML Technologies: The Big Picture ! Introducing XML Terminology ! Animation: Life Cycle of an XML Document In this section, you will be introduced to some of the terminology used by the XML community, and see how the various XML technologies fit together. Slide Objective To provide an overview of XML technologies and their roles in the life cycle of an XML document. Lead-in Some of the most commonly used XML terms are schemas, style sheets, validation, and the DOM. Module 2: Overview of XML Technologies 3 Introducing XML Terminology Style sheets Document Object Model (DOM) Validation Data binding XML The preceding illustration introduces some of the terms and technologies associated with XML. Let’s examine each of these items in detail. Style sheets When a user opens an XML document in Internet Explorer 5, the browser displays the document as a collapsible hierarchy of nodes, as shown in the following sample XML document: <?xml version="1.0"?> <booklist> <book> <title>The Gourmet Microwave</title> <isbn>72-80081-082</isbn> <publisher>New Moon Books</publisher> <price>9.95</price> </book> <book> <title>Sushi, Anyone?</title> <isbn>72-80081-024</isbn> <publisher>New Moon Books</publisher> <price>14.99</price> </book> </booklist> Slide Objective To introduce some of the terms and technologies associated with XML. Lead-in Let’s look at some of the important technologies associated with XML. Delivery Tip This slide is animated so that it shows each part of the illustration in stages. The slide is empty initially. Click the icons to reveal the following parts of the illustration: 1. The “XML” text in the middle of the slide. 2. The “style sheet” picture. 3. The “data binding” picture. 4. The “DOM” picture. 5. The “validation” picture. 4 Module 2: Overview of XML Technologies When this document is loaded into Internet Explorer 5, it is displayed as follows. To make the information more presentable to the user, a style sheet can be applied to the XML document to transform the XML into HTML elements. For example, a style sheet can be written that transforms the XML data into an HTML table as follows. There are two ways of defining style sheets for an XML document: ! Cascading style sheets (CSS) ! Extensible Style Language (XSL) [...]... < ?xml version="1.0" ?> < ?xml version="1.0" ?> XML definitions… XML definitions… < /XML> < /XML> Reference an XML file SRC="MyXmlData .xml" > < /XML> < /XML> A data island is an XML document that exists within an HTML page It allows you to script against the XML document without having to load it through... can the use the element to create a data island The XML data can be included within the HTML, or it can be in an external file Inline XML Inline XML is enclosed within the and < /XML> tags, as shown in the following code: < ?xml version="1.0" ?> XML definitions… < /XML> 20 Module 2: Overview of XML Technologies Reference an external XML file External XML uses the SRC... features of HTML The HTML page can also contain client-side script that allows dynamic content to be defined for the Web page Module 2: Overview of XML Technologies 19 Creating an XML Data Island Slide Objective To explain how to create an XML data island Lead-in ! Embed an XML data island in an HTML page You can include XML data in an HTML document $ $ Inline XML ... tag to reference an external file The SRC attribute can refer to a local file or specify a URL The following code shows how to use the SRC attribute with a local file: < /XML> The following code shows how to use the SRC attribute with a remote XML document on a Web site: < /XML> Module 2: Overview. .. variety of tools are available for viewing the tree structure of an XML document For example, Microsoft provides a tool called XML Tree Viewer, which takes an XML document and displays its contents as a tree For more information on the XML Tree Viewer and to download the program, see the XML and XSL Samples and Demos page at http://msdn.microsoft.com /xml/ demos/default.asp 28 Module 2: Overview of XML Technologies. .. you click one of the rows This is done by associating script with the various parts of the table Module 2: Overview of XML Technologies # Binding XML to HTML Slide Objective To provide an overview of the topics in this section Lead-in The XML Data Source Object (DSO) allows you to bind HTML elements to an XML data set ! Sending Data to the Client ! Creating an XML Data Island ! Binding XML Data to HTML... Model 22 Module 2: Overview of XML Technologies Displaying XML Data in an HTML Table Slide Objective To show how to bind an HTML table to an XML data island Lead-in If you want to display all the records of an XML data island concurrently, you can use a tabular control such as an HTML ! Binding a tabular HTML element to data at design time < ?xml version="1.0"... detail in Module 8, “Validating XML Data Using Schemas.” 6 Module 2: Overview of XML Technologies Animation: Life Cycle of an XML Document Lead-in In this animation, you will see how style sheets, data binding, the DOM, and validation all play a role in the life cycle of an XML document To see an animation on the life cycle of an XML document, run the “Life cycle of an XML document” media element on... red font style Module 2: Overview of XML Technologies Instead of defining the style sheet rules within the HTML document, you can also create a separate css file (for example MyStyles.css) and link the style sheet to the HTML document as follows: 9 10 Module 2: Overview of XML Technologies Using Cascading Style Sheets with XML Slide Objective... the following example: < ?xml version="1.0" ?> Roberts 23500 < /XML> Module 2: Overview of XML Technologies 23 The element is bound to the XML data island named MyXMLData The table defines . covered. 2 Module 2: Overview of XML Technologies # ## # XML Technologies: The Big Picture ! Introducing XML Terminology ! Animation: Life Cycle of an XML Document. Lab: 00 Minutes iv Module 2: Overview of XML Technologies Module Strategy Use the following strategies to present this module: ! XML Technologies: The Big

Ngày đăng: 26/10/2013, 23:15

TỪ KHÓA LIÊN QUAN