xs:IDREF

The type xs:IDREF represents a cross-reference to an xs:ID value. Like xs:ID, it is most commonly used to describe attribute values. Each attribute of type xs:IDREF must reference an ID in the same XML document. For example, the ref attribute of the fnref element in Example B-1 contains an xs:IDREF value (again, assuming it is validated with a schema). Its value, fn1, matches the value of the fnid attribute of the fn element. You can find all the xs:IDREF values that refer to a specific ID using the idref function.

Because xs:IDREF is ultimately derived from xs:string, xs:IDREF values can be compared and used like strings. For more information on working with IDREFs, see "Working with IDs" in Chapter 20.

Get XQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.