Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - ID and IDREF Files >Thread Next - Re: ID and IDREF Files Re: ID and IDREF FilesTo: NULL Date: 12/2/2007 5:00:00 PM
geoff wrote:
> This is how the book has the files (3 of them) but xml notepad says shipTo
> has to be filled out, I hate it when book examples do not work :(
>
>
> ======== INVOICE.XML ==========
>
> <?xml version="1.0" encoding="UTF-8"?>
> <invoice:invoice xmlns:invoice="http://www.skatestown.com/ns/invoice"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.skatestown.com/ns/invoice
> ./invoice.xsd"
> id="43871" submitted="2004-01-05" customerId="73852">
> <billTo id="addr-1">
> <company>The Skateboard Warehouse</company>
> <street>One Warehouse Park</street>
> <street>Building 17</street>
> <city>Boston</city>
> <state>MA</state>
> <postalCode>01775</postalCode>
> </billTo>
> <shipTo href="addr-1"/>
shipTo is defined here
> <xsd:complexType name="invoiceType">
> <xsd:sequence>
> <xsd:element name="billTo" type="po:addressType" />
> <xsd:element name="shipTo" type="po:addressType" />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
as being of type po:addressType and that is defined here
> <xsd:complexType name="addressType">
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string" minOccurs="0" />
> <xsd:element name="company" type="xsd:string" minOccurs="0" />
> <xsd:element name="street" type="xsd:string" maxOccurs="unbounded" />
> <xsd:element name="city" type="xsd:string" />
> <xsd:element name="state" type="xsd:string" minOccurs="0" />
> <xsd:element name="postalCode" type="xsd:string" minOccurs="0" />
> <xsd:element name="country" type="xsd:string" minOccurs="0" />
> </xsd:sequence>
> <xsd:attribute name="id" type="xsd:ID" />
> <xsd:attribute name="href" type="xsd:IDREF" />
> </xsd:complexType>
It has mandatory child elements like street and city.
As said in my reply to your first post, IDREF does not mean that the
referenced element is included.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
