Sample Input and Output: Purchase Order

We'll use the cocoa purchase order for converting from XML to a flat file format. The particular orders we will produce for Big Daddy's system are similar to the invoices in that they contain two logical groups of records. The top-level group is the overall purchase order, containing a header record, a ship to record, and one or more line item groups. The line item group consists of a line item record and an item description record. Table 8.2 shows the logical layout of the purchase order file.

The three purchase order instance documents shown below follow the logical organization specified in Table 8.2.

Sample FlatPurchaseOrders01.xml
 <?xml version="1.0" encoding="UTF-8"?> <PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.