S
srikantkt
I am working with a schema that uses xsd:ID to tag certain elements.
The corresponding elements that reference these elements use xsd:IDREF.
Now, this works as long as the ID is defined in the same document,
otherwise schema validation fails.
Is there any way for elements in one xml document reference elements in
another
For a trivial example, consider a document called "app.xml"
<properties name="ID001">
<property>
<name>foo</name>
<value>111</value>
</property>
<property>
<name>bar</name>
<value>222</value>
</property>
</properties>
<appContext>
<propertyRef id="ID001"/>
</appContext>
If all <properties> were externalized into a separate xml document (say
"props.xml") and the original "app.xml" is reduced to
<appContext>
<propertyRef id="ID001"/>
</appContext>
URI references is one option but assume they cannot be used, is there
any way to have a xml schema such that the above xml snippet is valid?
Is there any other way of tagging the id reference, say
<propertyRef id="props.xml#ID001"/> ?
thanks,
Srikant
The corresponding elements that reference these elements use xsd:IDREF.
Now, this works as long as the ID is defined in the same document,
otherwise schema validation fails.
Is there any way for elements in one xml document reference elements in
another
For a trivial example, consider a document called "app.xml"
<properties name="ID001">
<property>
<name>foo</name>
<value>111</value>
</property>
<property>
<name>bar</name>
<value>222</value>
</property>
</properties>
<appContext>
<propertyRef id="ID001"/>
</appContext>
If all <properties> were externalized into a separate xml document (say
"props.xml") and the original "app.xml" is reduced to
<appContext>
<propertyRef id="ID001"/>
</appContext>
URI references is one option but assume they cannot be used, is there
any way to have a xml schema such that the above xml snippet is valid?
Is there any other way of tagging the id reference, say
<propertyRef id="props.xml#ID001"/> ?
thanks,
Srikant