Java APIs for XML Kick Start By Aoyon Chowdhury, Parag Choudhary
Table of Contents
Appendix B. XML: A Quick Tour
Listing B.1 shows some XML code that describes car parts. This is a fairly simple XML document, but it has most of the components that constitute almost all XML documents. We will use this file in the rest of the appendix to explain the constituents of an XML document.
Listing B.1 CarParts.xml
<?xml version='1.0' standalone='yes'?> <!-- XML file that describes car parts --> <!DOCTYPE carparts[ <!ENTITY companyname "Heaven Car Parts (TM)"> <!ENTITY companyweb "http://carpartsheaven.com"> ]> <carparts> <?supplierformat format="X13" version="3.2"?> <hubcaps> hub cap1 </hubcaps> <supplier name="&companyname;" URL="&companyweb;"> </supplier> <engines> <engine type="Alpha37" capacity="2500" price="3500"> Engine 1 </engine> </engines> <carbodies> <carbody type="Tallboy" color="blue"> Car Body 1 </carbody> </carbodies> <wheels> <wheel type="X3527" price="120"> Wheel Set 1 </wheel> </wheels> <carstereos> <carstereo manufacturer="MagicSound" model="T76w" Price="500"> Car Stereo 1 </carstereo> </carstereos> <forCDATA><![CDATA[Special Text: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SAMS Publishing is the &best& <<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>..]] > </forCDATA> </carparts>