Jon Mcleod wrote:
> I am trying to structure an document schema that has a list of
> components, and a list of vendors. Each component "points" to a
> particular vendor using a vendor code.
>
> Until now, we've just included the vendor code in each component
> element. However, I'm trying to move everything into an XSD
> specification and I'm wondering if there is a "standard" way to do this,
> maybe with something like ID and IDREF?
>
> Below is a simplified example of the proprietary XML code we are using
> now. Any references or ideas of a better way to do this would be
> appreciated.
>
> ----
>
> <components>
> .
> .
> <component>
> <partno>74HC123</partno>
> <vendorcode>J1321999</vendorcode>
> </component>
> .
> .
> </components>
> <vendors>
> .
> .
> <vendor>
> <name>Arrow</name>
> <vendorcode>J1321999</vendorcode>
> </vendor>
> .
> .
> </vendors>
ID/IDREF is meant for attributes only, to be compatible with ID/IDREF in
DTDs. But the schema language provides xs:key/xs:keyref for your
purpose, see the primer
http://www.w3.org/TR/xmlschema-0/#sp...ysAndtheirRefs
--
Martin Honnen
http://JavaScript.FAQTs.com/