Using Namespaces to Mix XML Vocabularies

chinmay.sahoo

New member
If thoughtfully designed XML vocabularies already exist for a particular problem domain, it's a natural instinct of a good developer to want to reuse the existing vocabulary instead of inventing a new one. However, when attempting to combine the elements from two or more different XML vocabularies in a single document, name clashes can occur for common element names. XML namespaces provide a solution to this problem by specifying a mechanism to uniquely qualify
elements from different vocabularies.

Consider a fictitious tax advice company called Tax Time. A customer named Tina Wells calls to set up an appointment to discuss her income tax return with one of Tax Time's consultants, named Jim. Suppose that Tax Time uses an XML document like the following to represent Tina's


<Appointment> with Jim:
<Appointment>
<Name>Tina Wells</Name>
<Schedule For="04/20/2000">
<Consult With="Jim" Time="10:00am">
<Regarding>
<UnknownSubject/>
</Regarding>
</Consult>
<ArrangePayment With="Ella" Time="11:00am"/>
</Schedule>
</Appointment>

As part of a routine pre-visit screening, Jim's administrative assistant Ella calls Tina to get more details about the subject of her visit. She learns that Tina needs some advice on her Federal income tax Form 1040. Ella asks Tina to post her 1040 Form over secure HTTP to Tax Time's web site so Jim can review it before their meeting. Since Tina's tax preparation software supports the new XML-based IRS tax <Form> format:

<Form id="1040">
<Filer EFileECN="12345">
<Name>Tina Wells</Name>
<TaxpayerId>987-65-4321</TaxpayerId>
<Occupation>Vice President</Occupation>
</Filer>
<Schedule id="B">
<Dividend Amount="12358.74">
<Payer>Bank of America</Payer>
</Dividend>
</Schedule>
</Form>
 
Back
Top