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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top