IBM®
Skip to main content
    United States [change]      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
     
  XML on TPF: A Short Tutorial IBM

XML on TPF: A Short Tutorial — Page 6 of 10
Create the Sample XML Data Based on the XML Schema

Paul now writes the same sample data in an XML document based on his XML Schema rather than his DTD. He begins with the XML declaration statement, which includes the encoding he is using for this document:

        <?xml version="1.0" encoding="ISO-8859-1"?>
        
Next, he adds the statement to declare the root element of the XML document (PNRroot) and the XML Schema document on which the XML document is written (pnrs.xsd):
        <PNRroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="pnrs.xsd">
        
Finally, he can create some sample data by using the element and attribute names defined in the XML Schema. When he is done writing the sample XML data, Paul saves it to his workstation as pnrs.xml.

To view the full document, open Paul's second XML document in another browser window. See how the structure of the data matches that of the XML Schema you studied on the previous page. When you are done, close the window by clicking the X in the upper-right corner.

For More Information
See the TPF XML User's Guide for the following:

  • A list of books and Web sites for learning about writing XML documents
  • More information about well-formed and valid XML documents.

PreviousNext

Back to the Beginning
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

 

Close This Window.

 

    About IBM Privacy Contact