schematron question

S

shaun roe

I want to ensure that a reference from one element to another is valid,
e.g

<character name="sleepy">
<friends_with name="doc"/>
</character>

<character name="sneezy">
<friends_with name="sleepy"/>
</character>

I want to ensure that the value of the name attribute in "friends_with"
actually exists somewhere in the file as a <character name> somewhere.
(if the above were the entire file, then the first element would be
invalid since "doc" is not a charc ater name in the file)



Can I do this with schematron?
 
S

Steve Jorgensen

That can be done in W3C XML Schema (Presumably RelaxNG as well) using keys and
keyrefs. You could do it with Schematron if you really want to, but this is
not a case where you have to use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,000
Messages
2,570,252
Members
46,848
Latest member
CristineKo

Latest Threads

Top