Using Data Binding with XML
I'll start by converting ch08_01.html to XML. In ch08_01.html, I had to use the ID attribute of <SPAN> elements to name the fields in a record; in XML, I can simply create a new element. Here's what ch08_01.html looks like in XML format, ch08_03.xml:
Listing . ch08_03.xml
<?xml version="1.0"?> <CUSTOMERS> <CUSTOMER> <NAME>Charles</NAME> <CUSTOMER_ID>58704</CUSTOMER_ID> <PURCHASE_DATE>10/15/2003</PURCHASE_DATE> <DEPARTMENT>Meat</DEPARTMENT> <PRODUCT_NAME>Ham</PRODUCT_NAME> </CUSTOMER> <CUSTOMER> <NAME>Franklin</NAME> <CUSTOMER_ID>58705</CUSTOMER_ID> <PURCHASE_DATE>10/15/2003</PURCHASE_DATE> <DEPARTMENT>Produce</DEPARTMENT> <PRODUCT_NAME>Tomatoes</PRODUCT_NAME> </CUSTOMER> <CUSTOMER> <NAME>Phoebe</NAME> <CUSTOMER_ID>58706</CUSTOMER_ID> ... |
Get Real World XML 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.