June 2002
Intermediate to advanced
384 pages
7h 53m
English
Now that you know the theory, let’s see how it works in some real-life examples. The following sections illustrate how PHP’s SAX parser can be used to “do something useful” with XML data.
Consider the XML document in Listing 2.21, which contains an invoice for material delivered by Sammy’s Sports Store.
<?xml version="1.0"?> <!DOCTYPE invoice [ <!ENTITY message "Thank you for your purchases!"> <!ENTITY terms SYSTEM "terms.xml"> ]> <invoice> <customer> <name>Joe Wannabe</name> <address> <line>23, Great Bridge Road</line> <line>Bombay, MH</line> <line>India</line> </address> </customer> <date>2001-09-15</date> <reference>75-848478-98</reference> ... |