Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 14 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
14
Dung lượng
191,11 KB
Nội dung
Building XML-Based Web Applications Delivery Guide Course Number: 1905A Part Number: X05-42123 Released: 04/07/00 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, FrontPage, IntelliSense, MSDN, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual Studio, 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 Course Number: 1905A Part Number: X05-42123 Released: 04/07/00 Building XML-Based Web Applications iii Contents Introduction Course Materials Prerequisites Course Objectives Course Outline Course Outline (continued) Setup Microsoft Certified Professional Program Facilities 10 Module 1: Overview of XML Documents Overview Structuring Data What is XML? 10 Creating XML Documents 19 Grammars and Namespaces 36 Demonstration: The LitWare Books Application 42 Review 43 Module 2: Overview of XML Technologies Overview XML Technologies: The Big Picture Viewing XML with Style Sheets Binding XML to HTML 17 Accessing XML with the Document Object Model 25 Validating XML 32 Review 43 Module 3: Generating XML Data from a Database Overview Overview of XML-Based Web Applications Using Active Server Pages 10 Lab 3.1: Creating and Using an Active Server Page 22 Accessing Data with ADO 29 Returning XML to the Client 42 Lab 3.2: Querying a Database and Returning XML Data 50 Review 63 Module 4: Displaying an XML Document Using XSL Overview Transforming XML with XSL Using Templates Filtering and Sorting XML 22 XSL Language Constructs 33 Creating New Nodes Dynamically 39 Lab 4: Displaying an XML Document Using XSL 44 Review 52 Module 5: Embedding XML Data in HTML iv Building XML-Based Web Applications Overview Using Data in Web Browsers Data Binding 10 Manipulating the Data Source 24 Lab 5: Embedding XML Data in HTML 37 Review 47 Module 6: Manipulating XML Data on the Client Using DOM Overview The DOM View of XML Documents Accessing DOM Trees Transforming XML with XSL Programmatically 22 Lab 6.1: Transforming XML Data on the Client 31 Working with Elements and Attributes 36 Lab 6.2: Manipulating XML Data on the Client 49 Displaying XML Data Using DOM 57 Lab 6.3: Displaying XML Data Using DOM 65 Review 72 Module 7: Posting XML Data from Client to Server Overview Preparing XML Data on the Client Posting Data to the Server 11 Lab 7.1: Sending XML Packets to the Server 16 DOM Manipulation on the Server 24 Receiving the Response on the Client 36 Lab 7.2: Processing XML Packets at the Server 42 Review 54 Module 8: Validating XML Data Using Schemas Overview The Need for Validation Writing an XML Schema 15 Extending an XML Schema 34 Validating XML in a Client/Server Environment 38 Lab 8: Validating XML Data Using Schemas 46 Review 54 Module 9: Introducing BizTalk Overview Business-to-Business Challenges Overview of BizTalk BizTalk Jumpstart Kit 13 Review 18 Appendix A: Lab Answers Lab 3.1: Creating and Using an Active Server Page Lab 3.2: Querying a Database and Returning XML Data Lab 4: Displaying an XML Document Using XSL 12 Lab 5: Embedding XML Data in HTML 18 Lab 6.1: Transforming XML Data on the Client 26 Lab 6.2: Manipulating XML Data on the Client 28 Lab 6.3: Displaying XML Data Using DOM 35 Building XML-Based Web Applications v Lab 7.1: Sending XML Packets to the Server 41 Lab 7.2: Processing XML Packets at the Server 47 Lab 8: Validating XML Data Using Schemas 59 Appendix B Building XML-Based Web Applications vii About This Course This section provides you with a brief description of the course, audience, suggested prerequisites, and course objectives Description This course will familiarize students with XML and teach them how to build web applications using XML It teaches developers how to build a Web application that connects to and retrieves data from a database, displays the data by using XML, and saves updates from the client back to the database Audience This course is intended for Web developers who have created dynamic web applications that access data in a database on a server, and Visual Basic, Office, and SQL Server developers who have created client/server applications that access data in a database Student Prerequisites This course requires that students meet the following prerequisites: ! Knowledge of HTML ! Knowledge of relational databases ! Programming using Visual Basic, Visual Basic for Applications, or VBScript: creating procedures, using loops, using variables, using COM objects ! Knowledge of a data access API such as DAO, RDO, or ADO Taking one or more of the following courses will help students meet the prerequisites and get more out of the course: ! Course 1017 Mastering Web Application Development Using Microsoft Visual InterDev ! Course 1013 Mastering Microsoft Visual Basic Development Course Objectives After completing this course, the student will be able to: ! List the uses and benefits of XML in a Web site ! Create well-formed and valid XML documents ! Create a schema ! Use XSL to display XML data in a Web browser ! Use XSL to transform XML data into a different XML format ! Display dynamic XML data in a Web browser by using data binding and the Document Object Model ! Use ASP and ADO to read data from a data source and store it as XML ! Add, delete, update data from the client using XML and save to a database on the server viii Building XML-Based Web Applications Course Timing The following schedule is an estimate of the course timing Your timing may vary Day Start End Module 9:00 9:30 Introduction 9:30 9:45 Break 9:45 11:45 Module 1: Overview of XML Documents 11:45 12:45 Lunch 12:45 2:45 Module 2: Overview of XML Technologies 2:45 3: 00 Break 3:00 4:00 Module 2: Overview of XML Technologies (continued) Start End Module 9:00 10:00 Module 3: Generating XML Data from a Database 10:00 10:30 Lab 3.1: Creating and Using an Active Server Page 10:30 10:45 Break 10:45 11:45 Module 3: Generating XML Data from a Database (continued) 11:45 12:45 Lunch 12:45 1:45 Lab 3.2: Querying a Database and Returning XML Data 1:45 3:00 Module 4: Displaying an XML Document Using XSL 3:00 3:15 Break 3:15 4:45 Module 4: Displaying an XML Document Using XSL (continued) Day Building XML-Based Web Applications ix Day Start End Module 9:00 10:00 Lab 4: Displaying an XML Document Using XSL 10:00 10:15 Break 10:15 12:15 Module 5: Embedding XML Data in HTML 12:15 1:15 Lunch 1:15 2:15 Lab 5: Embedding XML Data in HTML 2:15 2:30 Break 2:30 4:00 Module 6: Manipulating XML Data on the Client Using DOM 4:00 4:30 Lab 6.1: Transforming XML Data on the Client Start End Module 9:00 10:00 Module 6: Manipulating XML Data on the Client Using DOM (continued) 10:00 11:00 Lab 6.2: Manipulating XML Data on the Client 11:00 11:15 Break 11:15 11:45 Module 6: Manipulating XML Data on the Client Using DOM (continued) 11:45 12:45 Lunch 12:45 1:30 Lab 6.3: Displaying XML Data Using DOM 1:30 3:00 Module 7: Posting XML Data from Client to Server 3:00 3:15 Break 3:15 4:00 Lab 7.1:Sending XML Packets to the Server 4:00 4:30 Module 7: Posting XML Data from Client to Server (continued) Start End Module 9:00 9:30 Lab 7.2: Processing XML Packets at the Server 9:30 10:30 Module 8: Validating XML Data Using Schemas 10:30 10:45 Break 10:45 12:15 Module 8: Validating XML Data Using Schemas (continued) 12:15 1:15 Lunch 1:15 2:15 Lab 8: Validating XML Data Using Schemas 2:15 2:30 Break 2:30 3:30 Module 9: Introducing BizTalk Day Day x Building XML-Based Web Applications Trainer Materials Compact Disc Contents The Trainer Materials compact disc contains the following files and folders: ! Autorun.exe When the CD is inserted into the CD-ROM drive, or when you double-click the autorun.exe file, this file opens the CD and allows you to browse the Student Materials or Trainer Materials CD, or install Internet Explorer ! Default.htm This file opens the Trainer Materials Web page ! Readme.txt This file contains a description of the compact disc contents and setup instructions in ASCII format (non-Microsoft Word document) ! 1905A_sg.doc This file is the Classroom Setup Guide It contains a description of classroom requirements, classroom configuration, and classroom setup instructions ! CD_Student This folder contains the Web page that provides students with links to resources pertaining to this course, including additional reading, review and lab answers, lab files, multimedia presentations, and courserelated Web sites ! Errorlog This folder contains a template that is used to record any errors and corrections that you find in the course ! Fonts This folder contains fonts that are required to view the Microsoft PowerPoint presentation and Web-based materials ! Powerpnt This folder contains the PowerPoint slides that are used in this course ! Pptview This folder contains the PowerPoint Viewer, which is used to display the PowerPoint slides ! Webfiles This folder contains the files that are required to view the course Web page To open the Web page, open Windows Explorer, and in the root directory of the compact disc, double-click Default.htm or Autorun.exe Building XML-Based Web Applications xi Student Materials Compact Disc Contents The Student Materials compact disc contains the following files and folders: ! Autorun.exe When the CD is inserted into the CD-ROM drive, or when you double-click the autorun.exe file, this file opens the CD and allows you to browse the Student Materials CD or install Internet Explorer ! Default.htm This file opens the Student Materials Web page It provides students with resources pertaining to this course, including additional reading, review and lab answers, lab files, multimedia presentations, and course-related Web sites ! Readme.txt This file contains a description of the compact disc contents and setup instructions in ASCII format (non-Microsoft Word document) ! 1905A_sg.doc This file is the Classroom Setup Guide It contains a description of classroom requirements, classroom setup instructions, and the classroom configuration ! Addread This folder contains additional reading pertaining to this course If there are no additional reading files, this folder does not appear ! Appendix This folder contains appendix files for this course If there are no appendix files, this folder does not appear ! Democode This folder contains demonstration code If there is no demonstration code, the Democode folder does not appear ! Fonts This folder contains fonts that are required to view the PowerPoint presentation and Web-based materials ! Ie5 This folder contains Microsoft Internet Explorer ! Labs This folder contains files that are used in the hands-on labs These files may be used to prepare the student computers for the hands-on labs ! LitWareSolution This folder contains files that are the solution to the handson labs These files may be used to view the solution to the hands-on labs ! Media This folder contains files that are used in multimedia presentations for this course If this course does not include any multimedia presentations, this folder does not appear ! Menu This folder contains elements for autorun.exe ! Mplayer This folder contains files that are required to install Microsoft Windows Media Player ! Pptview This folder contains the PowerPoint Viewer, which is used to display the PowerPoint presentations that accompany the additional reading If there are no PowerPoint presentations, this folder does not appear ! Practices This folder contains files that are used in the hands-on practices If there are no practices, the Practices folder does not appear ! Sampapps This folder contains the sample applications associated with this course If there are no associated sample applications, the Sampapps folder does not appear ! Sampcode This folder contains sample code that is accessible through the Web pages on the Student Materials CD If there is no sample code, the Sampcode folder does not appear xii Building XML-Based Web Applications ! Sampsite This folder contains files that create the sample site associated with this course If there is no sample site, the Sampsite folder does not appear ! Setup This folder contains additional files that may be required for lab setup If no additional files are required, the Setup folder does not appear ! Webfiles This folder contains the files that are required to view the course Web page To open the Web page, open Windows Explorer, and in the root directory of the compact disc, double-click Default.htm or Autorun.exe ! Wordview This folder contains the Word Viewer that is used to view any Word document (.doc) files that are included on the compact disc If no Word documents are included, this folder does not appear ! Xmlreskit This folder contains the Microsoft Windows DNA XML Resource Kit Building XML-Based Web Applications xiii Document Conventions The following conventions are used in course materials to distinguish elements of the text Convention Use # Indicates an introductory page This symbol appears next to a slide title when additional information on the topic is covered on the page or pages that follow it bold Represents commands, command options, and portions of syntax that must be typed exactly as shown It also indicates commands on menus and buttons, dialog box titles and options, and menu names italic In syntax statements or descriptive text, indicates argument names or placeholders for variable information Italic is also used for book titles Title Capitals Indicate domain names, user names, computer names, directory names, folders, and file names, except when specifically referring to case-sensitive names Unless otherwise indicated, you can use lowercase letters when you type a directory name or file name in a dialog box or at a command prompt ALL CAPITALS Indicate the names of keys, key sequences, and key combinations — for example, ALT+SPACEBAR monospace Represents code samples, examples of screen text, or entries that you type at a command prompt or in initialization files [] In syntax statements, enclose optional items For example, [filename] in command syntax indicates that you can choose to type a file name with the command Type only the information within the brackets, not the brackets themselves {} In syntax statements, enclose required items Type only the information within the braces, not the braces themselves | In syntax statements, separates an either/or choice ! Indicates a procedure with sequential steps In syntax statements, specifies that the preceding item may be repeated Represents an omitted portion of a code sample THIS PAGE INTENTIONALLY LEFT BLANK Last Saved: 8/8/2000 4:08 PM Last Printed: 8/8/2000 4:10 PM ... Review 52 Module 5: Embedding XML Data in HTML iv Building XML-Based Web Applications Overview Using Data in Web Browsers Data Binding 10 Manipulating... that is accessible through the Web pages on the Student Materials CD If there is no sample code, the Sampcode folder does not appear xii Building XML-Based Web Applications ! Sampsite This folder... Manipulating XML Data on the Client 28 Lab 6.3: Displaying XML Data Using DOM 35 Building XML-Based Web Applications v Lab 7.1: Sending XML Packets to the Server 41 Lab 7.2: Processing