O'Reilly logo

Learning XML by Erik T. Ray

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.5. Example: Checkbook

It's time now for a useful example that demonstrates the concepts discussed so far. The checkbook from Example 5.1 is a good test subject, so we'll use it again. Example 6.4 shows another instance of the Checkbook document. This is the same document used in Chapter 5, except that another <payment> has been added at the end, resulting in a negative balance:

Example 6.4. Checkbook Instance
<?xml version="1.0"?> <!DOCTYPE checkbook SYSTEM "checkbook.dtd"> <checkbook> <deposit type="direct-deposit"> <payor>Bob's Bolts</payor> <amount>987.32</amount> <date>21-6-00</date> <description category="income">Paycheck</description> </deposit> <payment type="check" label="980"> <payee>Kimora's Sports Equipment</payee> <amount>132.77</amount> <date>23-6-00</date> <description category="entertainment">kendo equipment</description> </payment> <payment type="atm"> <amount>40.00</amount> <date>24-6-00</date> <description category="cash">pocket money</description> </payment> <payment type="debit"> <payee>Lone Star Cafe</payee> <amount>36.86</amount> <date>26-6-00</date> <description category="food">lunch with Greg</description> </payment> <payment type="check" label="981"> <payee>Wild Oats Market</payee> <amount>47.28</amount> <date>29-6-00</date> <description category="food">groceries</description> </payment> <payment type="debit"> <payee>Barnes and Noble</payee> <amount>58.79</amount> <date>30-6-00</date> <description category="work">O'Reilly Books</description> </payment> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required