Creating the XML Content
Listing 12.2 shows a sample XML loan document that is valid according to
the DTD in Listing 12.1. Because we created this sample XML loan document
manually, we inten-tionally simplified our task by making the term of the loan
short—three months. Given the principal, the term in months, and interest rate
key loan criteria, we used the formulas presented previously to compute the
derived values in the document, including the monthly payment amount and
payment data points over the lifetime of the loan.
LISTING 12.2 3MonthLoan.xml--Sample Loan XML (Three Month)
<?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE loan SYSTEM
“Loan.dtd”>
<loan principal=”10000.00” termInMonths=”3” interestRate=”30” ➥ monthlyPayment=”3501.37”>
<payment
monthIndex=”0”
principalOutstanding=”10000.00”
➥ principalPayment=”0.00” interestPayment=”0.00”/>
<payment monthIndex=”1” principalOutstanding=”6748.63”
➥ principalPayment=”3251.37”
interestPayment=”250.00”/> <payment monthIndex=”2”
principalOutstanding=”3415.97”
➥ principalPayment=”3332.66”
interestPayment=”168.72”/> <payment monthIndex=”3”
principalOutstanding=”0.00”
➥ principalPayment=”3415.97” interestPayment=”85.40”/> </loan>
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.