W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2001

IDREFs and IDs

From: Hewko, Doug <Doug.Hewko@ccra-adrc.gc.ca>
Date: Thu, 6 Sep 2001 10:31:17 -0400
Message-ID: <6B3877B8D238D511852700B0D068CA9D906038@SH24X693>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
In schemas, how do you ensure that a IDREF (identifier reference)
corresponds to a particular ID? According to the book I am reading, a
identifier reference will "ensure that the value of an XML attribute matches
a previously defined unique identifier" ("XML, your visual blueprint for
building expert web pages", by meranGraphics and IDG Books, page 106)

An example of an ID declaration that they provide is:
-	example:
-	<AttributeType name="product_code" dt:type="id" />
-	<ElementType name="product" content="eltOnly" model="closed">
-	<attribute type="product_code"/>
-	</ElementType>

While the IDREF is: 
-	<AttributeType name="bestseller" dt:type="idref" />
-	<ElementType name="name" content="eltOnly" model="closed">
-	<attribute type="bestseller"/>
-	</ElementType>

There does not appear to be anything saying that "bestseller" must match the
entries in "product". 
Received on Thursday, 6 September 2001 10:30:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:51 GMT