1 / 86

Introduction

Introduction. Extensible Markup Language (XML) Uses tags to describe the structure of a document Simplifies the process of sharing information Extensible Stylesheet Language (XSL) XML is a subset of Standard Generalized Markup Language. Introduction. Introduction. Introduction.

terra
Télécharger la présentation

Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction • Extensible Markup Language (XML) • Uses tags to describe the structure of a document • Simplifies the process of sharing information • Extensible Stylesheet Language (XSL) • XML is a subset of Standard Generalized Markup Language

  2. Introduction

  3. Introduction

  4. Introduction • Documents must be well-formed • Must adhere to the basic syntax rules for XML and contain at least one root element • A parser is an XML processor that verifies the document follows the syntax rules for a well-formed document and converts the document into a tree of elements

  5. Introduction

  6. Creating a Well-Formed XML Document • Prolog • Contains declaration and processing instruction statements • Document instance • Contains the main content or elements of the XML document • Processing instruction • One or more instructions passed to the application using the XML document • XML declaration • Processing instruction statement identifying the version of XML used in the document

  7. Creating a Well-Formed XML Document • Document type declaration • A processing instruction that tells the processor where to locate the Document Type Definition • Document Type Definition (DTD) • Defines the elements and attributes in an XML document • Validity of XML documents • Instance • Occurrence of XML elements • Root element • The main element in an XML document

  8. Document Type Definition (DTD)

  9. Creating the Prolog in an XML Document

  10. Creating the Prolog in an XML Document

  11. Creating the Document Instance in an XML Document

  12. Creating the Document Instance in an XML Document • Generic Identifier (GI) • The name that a developer provides for the tags • Namespace • A unique identifier or prefix used to identify tags that have the same name • Relation • A collection of data • Schema • States the relation name and follows with a list of attributes or fields in parentheses

  13. Linking a Cascading Style Sheet to Format an XML Document • Makes XML easier to read • Start a new Notepad document • Click line 1 • Enter the code shown on the following slide

  14. Formatting and Manipulating an XML Document Using an XSL Style Sheet • Extensible Stylesheet Language • Binding XML documents to HTML Web pages

  15. Formatting and Manipulating an XML Document Using an XSL Style Sheet • Transforming an XML document • The XSL style sheet tells the browser or parser to output the XML document in a completely different form, such as HTML • Source • Result tree

  16. Creating an XSL Style Sheet • Stylesheet element • Establishes a namespace, so the remaining elements can use names that will not be confused with other elements

  17. Creating an XSL Style Sheet • Template • An instruction that identifies which elements in a document should be transformed, and how they should be transformed

  18. Adding XML Tags to a Template Element in an XSL Style Sheet • Click line 4 • Enter the code shown on the following slide

  19. Adding XML Tags to a Template Element in an XSL Style Sheet • for-each element • Makes each element of the XML document display in the table

  20. Adding XML Tags to a Template Element in an XSL Style Sheet • value-of element • Defines the display for each element within the PHONELIST

  21. Saving an XSL Style Sheet • With your HTML Data Disk in drive A, click File on the menu bar and then click Save As. Type xslalphaclublist.xsl in the File name text box. Save to the Project 11 folder on your HTML Data Disk

  22. Linking an XSL Style Sheet to an XML Document

  23. Linking an XSL Style Sheetto an XML Document • Activate the Notepad window containing the XML document, clublist.xml • Click line 3 • Type <?xml-stylesheet type=“text/xsl” href=“xslalphaclublist.xsl”?> but do not press the ENTER key

  24. Saving and Testing an XML Document Formatted Using an XSL Style Sheet • With your HTML Data Disk in drive A, click File on the menu bar and then click Save As. Type clublist-xsl.xml in the File name text box. Save to the Project 11 folder on your HTML Data Disk • Activate the browser • Click the Address bar. Type a:\Project 11\clublist-xsl.xml and then press the ENTER key

  25. Closing the Notepad Window Containing the XSL Style Sheet • Activate the Notepad window containing the XSL style sheet, xslalphaclublist.xsl • Click the Close button on the Notepad title bar

  26. Using Paging to Display XML Data in a Table • Data binding • Mapping the XML elements to a data format that preserves the hierarchy of the data and allows the data to be manipulated using different methods

  27. Using Paging to Display XML Data in a Table • Data island • A set of data elements separate from the main HTML Web page • Data Source Object (dso) • Recordset • A collection of data records and their fields

  28. Using Paging to Display XML Data in a Table

  29. Creating an HTML Document to Display XML Data in a Table • Activate the Notepad Window containing the XML document, clublist-xsl.xml • With the HTML Data Disk in drive A, open the file, clubsponsor.htm • Save this file to the Project 11 Folder on your Data Disk with the name, clubsponsor-table.htm

  30. Entering Code to Bind an XML Document with an HTML Web Page • With the clubsponsor-table.htm Notepad window active, click line 6 • Type <XML ID=“dsoClub” SRC=“clublist.xml”></XML> but do not press the ENTER key

  31. Entering Code to Add Navigation Buttons

  32. Entering Code to Add Navigation Buttons • Click line 12 • Enter the following code:

More Related