INFO:
jview /cp f:\msxml\classes;f:\msxml; msxml -d1 openPC.xml
XML:
<?xml version="1.0"?> <!DOCTYPE openPC SYSTEM "openPC.dtd"> <openPC> <item type = "PC" code = "ACME1"> <make> <brand>Acme Deluxe</brand> <supplier id = "Acme"/> </make> <specification> <cpu type = "986" speed = "500"/> <harddisk type = "IDE" size = "10" units = "GB"/> </specification> <price n = "2000" units = "USD"/> <blurb> <p>A versatile PC for home & business use. Fea- turing as standard:</p> <ul> <li><index term = "Multimedia"/>Sound card</li> <li>90 day money back guarantee</li> <li>Mouse Mat</li> </ul> </blurb> <internal> <instock num = "44"/> <supportcalls num = "6"/> <perunitcost n = "1800" units = "USD"/> </internal> </item> </openPC>
DTD:
<!-- Document type Definition for the OpenPC catalog application --> <!-- An openPC document contains one or more items --> <!ELEMENT openPC (item)+> <!-- an item contains these five subelements in this sequence --> <!ELEMENT item (make, specification, price, blurb, internal)> <!-- Every item is either a PC or a PRINTER. This is indicated by its type attribute. If a value is not supplied for this attribute, it defaults to PC --> <!ATTLIST item type (PC|PRINTER) "PC"> <!-- Every item also has a code attribute. No two items can share the same code. --> <!ATTLIST item code ID #REQUIRED> <!-- A specification element consists of a cpu element optionally followed by a harddisk element --> <!ELEMENT specification (cpu,harddisk?)> <!-- A blurb element consists of one of more p or ul elements --> <!ELEMENT blurb (p|ul)+> <!-- A p element contains a mixture of character data and index elements. Zero or more can occur --> <!ELEMENT p (#PCDATA|index)*> <!-- An index element is empty. It does not have any content --> <!ELEMENT index EMPTY> <!-- Ab index element has a term attribute. A value for this must always be supplied --> <!ATTLIST index term CDATA #REQUIRED> <!ELEMENT supplier EMPTY> <!ATTLIST supplier id CDATA #REQUIRED> <!ELEMENT make (brand,supplier)> <!ELEMENT li (#PCDATA|index)*> <!ELEMENT brand (#PCDATA)> <!ELEMENT cpu EMPTY> <!ATTLIST cpu type CDATA #REQUIRED speed CDATA #REQUIRED> <!ELEMENT harddisk EMPTY> <!ATTLIST harddisk type (IDE|EIDE|SCSI) "IDE" size CDATA #REQUIRED units (GB|TB) "GB"> <!ELEMENT price EMPTY> <!ATTLIST price n CDATA #REQUIRED units CDATA #REQUIRED> <!ELEMENT ul (li)+> <!ELEMENT internal (instock,supportcalls,perunitcost)> <!ELEMENT instock EMPTY> <!ATTLIST instock num CDATA #REQUIRED> <!ELEMENT supportcalls EMPTY> <!ATTLIST supportcalls num CDATA #REQUIRED> <!ELEMENT perunitcost EMPTY> <!ATTLIST perunitcost n CDATA #REQUIRED units CDATA #REQUIRED>
OUTPUT: