The following is a catalog document that is valid according to the
specifications detailed in assignment 3. You may copy and paste it
into a file of your own for testing purposes. It is also available
as good_catalog3.xml
<?xml version="1.0"?> <catalog> <company>Office Magick</company> <department name="Office Supplies" code="D235"> <item> <name>Stapler</name> <manufacturer>Bostich</manufacturer> <color-list> <color sku="S367-BL" hex="#000000">black</color> <color sku="S367-PY" hex="#ffffcc">pastel yellow</color> </color-list> <price amt="8.95" /> <summary>Heavy-duty office stapler</summary> <description> This stapler has a 30-sheet capacity and a lever action for accurate placement. </description> </item> <item> <name>Notebook</name> <price amt="3.00" units="CDN"/> <color-list> <color sku="N1783-GR" hex="#00ff00">Green</color> <color sku="N1783-YE" hex="#ffff00">Yellow</color> <color hex="#ff0000" sku="N1783-Rd">Red</color> </color-list> <summary>80-page notebook</summary> </item> </department> <department name="Computer Peripherals" code="D240"> <item> <name>Zip Drive</name> <price units="USD" amt="100.00"/> <manufacturer>IOMEGA</manufacturer> <color sku="ZD250">Black</color> <summary>250 MByte Zip Drive</summary> <description xmlns:html="http://www.w3.org/1999/xhtml"> Features of this 250 MByte Zip Drive: <html:ul> <html:li> USB Interface </html:li> <html:li> Built-in power supply; no "brick adapter" required </html:li> <html:li> Can read and write 100MB Zip disks </html:li> </html:ul> </description> </item> <item> <name>USB Cable</name> <price amt="8.95"/> <sku>UC520</sku> <summary>USB Cable - 1 meter</summary> <description xmlns:xh="http://www.w3.org/1999/xhtml"> <xh:p> This is a one-meter USB Cable. <xh:strong><xh:em>For longer distances, consider purchasing a USB Extender cable.</xh:em></xh:strong> </xh:p> </description> </item> <item> <name>USB Extender Cable</name> <sku>UC520-MM</sku> <price amt="8.95"/> <summary>USB Extender Cable</summary> <description> This is a 3-meter USB extender cable, with a male-to-male adapter. </description> </item> </department> </catalog>
The following catalog document is invalid with respect to the
specifications detailed in assignment 3. You may copy and paste it
into a file of your own for testing purposes. It is also available
as bad_catalog3.xml
<?xml version="1.0"?> <catalog> <company>Office Magick</company> <department name="Office Supplies" code="D235"> <item> <name>Stapler</name> <!-- manufacturer is misspelled as mfr --> <mfr>Bostich</mfr> <color-list> <!-- first sku is missing a second letter --> <color sku="S367-B" hex="#000000">black</color> <color sku="S367-PY" hex="#ffffcc">pastel yellow</color> </color-list> <!-- invalid amount with bad units --> <price amt="ten dollars" units="yen"/> <!-- required summary is missing --> <description> This stapler has a 30-sheet capacity and a lever action for accurate placement. </description> </item> <item> <name>Notebook</name> <price amt="3.00" units="CDN"/> <color-list> <!-- patterns are invalid --> <color sku="n1783-GR" hex="#00ff00">Green</color> <color sku="N1783-" hex="#ffff00">Yellow</color> <color hex="#ff0000" sku="N-1783-GR">Red</color> </color-list> <summary>80-page notebook</summary> </item> </department> <!-- duplicate ID for department --> <department name="Computer Peripherals" code="D235"> <item> <name>Zip Drive</name> <price units="USD" amt="100.00"/> <manufacturer>IOMEGA</manufacturer> <color sku="ZD250">Black</color> <summary>250 MByte Zip Drive</summary> <description xmlns:html="http://www.w3.org/1999/xhtml"> Features of this 250 MByte Zip Drive: <html:ul> <html:li> USB Interface </html:li> <html:li> Built-in power supply; no "brick adapter" required </html:li> <html:li> <!-- missing namespace --> Can read <em>and write</em> 100MB Zip disks </html:li> </html:ul> </description> </item> <item> <name>USB Cable</name> <price amt="8.95"/> <sku>UC520</sku> <summary>USB Cable - 1 meter</summary> <description xmlns:xh="http://www.w3.org/1999/xhtml"> <!-- emphasis must be inside paragraph --> <xh:em><xh:p> This is a one-meter USB Cable. For longer distances, consider purchasing a USB Extender cable. </xh:p></xh:em> </description> </item> <item> <name>USB Extender Cable</name> <sku>UC520-MM</sku> <price amt="8.95"/> <summary>USB Extender Cable</summary> <description> This is a 3-meter USB extender cable, with a male-to-male adapter. </description> </item> </department> </catalog>