
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Tearing Apart an XML Document
|
859
The “envelopes” containing the various pieces of XML data for the web services are
listed below.
BillingEnvelope XML
<BillingEnvelope invoiceDate="2003-10-05" invoiceNumber="INV-01">
<billInfo>
<name>Beerly Standing</name>
<attn>Accounting</attn>
<street>98 North Street</street>
<city>Intox</city>
<state>NH</state>
</billInfo>
</BillingEnvelope>
ShippingEnvelope XML
<ShippingEnvelope invoiceDate="2003-10-05" invoiceNumber="INV-01">
<shipInfo>
<name>Beerly Standing</name>
<attn>Receiving</attn>
<street>47 South Street</street>
<city>Intox</city>
<state>NH</state>
</shipInfo>
</ShippingEnvelope>
FulfillmentEnvelope XML
<FulfillmentEnvelope invoiceDate="2003-10-05" invoiceNumber="INV-01">
<item partNum="98745">
<productName>Brown Eyed Stout</productName>
<quantity>12</quantity>
<price>23.99</price>
<shipDate>2003-12-20</shipDate>
</item>
<item partNum="34987">
<productName>Diamond Pearl Lager</productName>
<quantity>22</quantity>
<price>35.98</price>
<shipDate>2003-12-20</shipDate>
</item>
<item partNum="AK254">
<productName>Job Site Ale</productName>
<quantity>50</quantity>
<price>12.56</price>
<shipDate>2003-11-12</shipDate>
</item>
</FulfillmentEnvelope>
Discussion
In order to tear apart the invoice, you need to establish what pieces go to which