Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - external id references

 
Thread Tools Search this Thread
Old 07-17-2006, 07:41 PM   #1
Default external id references


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



srikantkt@gmail.com
  Reply With Quote
Old 07-17-2006, 10:50 PM   #2
Joe Kesselman
 
Posts: n/a
Default Re: external id references

wrote:
> Is there any way for elements in one xml document reference elements in
> another


HTML's href syntax used
"http://www.whatever.com/otherDocument.html#idInThatDocument"

The more general/official answer would be XPointer or XLink syntax.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump