xs:IDREF accross schemas

I have a schema “CapabilityType” in which i have an attribute “id” of type xs:ID for each CapabilityTypeDocument.

I also have a schema “Capability” in which there is an attribute “primary_type_id” of type xs:IDREF

both schemas reside in the same collection.

When i try to set the attribute /Capability/@primary_type_id to a value that was queried from /CapabilityType/@id Tamino returns and error “StoreException occurred: insert failed” with the stacktrace being Tamino access failure (INOXDE7714, (cvc-id.1): undefined IDREF value, Line 1, Column 54: [IDREF value: df4gjp1x]) where ‘df4gjp1x’ is an @id of a CapabilityType

It seems like the IDREFs are only within the context of a schema instead of a collection.

Q1: Is there a way arround this ?

Q1.1: is it even worth making /CapabilityType/@id an xs:ID type and /Capability/@primary_type_id an xs:IDREF instead of an xs:string ?

–joeycz


X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tomcat 4.1.1
JDK Version : 1.4.1

As far as I know, ID/IDREF work within the same document only. XLink or XPointer is meant to reference accross documents.

Michael

Software AG Germany, Darmstadt

Hello,

as I know the XML Schema specification defines IDREF and ID for a document context. As long as there is no relationship within the documents itself, I would use xs:string instead of xs:ID and xs:IDREF.

I don’t know another concept that proves the relationship between documents automatically.

A possible solution could be a plugin for a Capability document that checks the uniqueness of the ID relationship to the sub-documents when it is committed in case of inserting / deleting / updating.

Bye,
Christian.

Thanks for the tips…
I have decided to replace the xs:ID and xs:IDREF types with xs:string since there is no abvious advantage in using them across documents.

Thanks.

–joeycz

X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tomcat 4.1.18
JDK Version : 1.4.1