XSD restriction of nesting an element within another element with aspecific attribute value?

P

PeteOlcott

<ElementName AttributeName="Specific Value">
<OtherElementName />
</ElementName>

The idea is to somehow force the restriction that the
<OtherElementName> element can only be nested within the <ElementName>
tag if this tag has the attribute value of "Specific Value" for its
attribute named AttributeName.
 
M

Mukul Gandhi

<ElementName AttributeName="Specific Value">
  <OtherElementName />
</ElementName>

 The idea is to somehow force the restriction that the
<OtherElementName> element can only be nested within the <ElementName>
tag if this tag has the attribute value of "Specific Value" for its
attribute named AttributeName.

This could be difficult with XSD 1.0. But you could do some validation
at an application level.

XSD 1.1 has a facility called 'assertions' which will make this
requirement solved easily (ref, http://www.w3.org/TR/xmlschema11-1/#cAssertions).

But XSD 1.1 is currently in draft. I am hoping we would see XSD 1.1
becoming a recommendation soon, and implemented in products.
 

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
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top