XML xsd help
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Wed Sep 28, 2005 8:31 am
XML xsd help
Hey peoples!
Got a situation I have to find my way around, but I want to know if there even is a way around:
Say I have an XML document that has the following
<student no="1">Baxter</student>
The xsd schema allows the integers 1 through to 9 for the 'student no' attribute and the strings, say Baxter, Erin, Katie.... for the 'Student' element content.
I've got a handle on the enumeration for this, however what I really want is for the enumerations to be linked, so to speak.
Like this, if the xml document were to have 'student no' as 1, then the only string that can be inserted as 'student' element content is 'Baxter'
I.e This is valid :
<student no="1">Baxter</student>
This will not be valid:
<student no="1">Somename</student>
Thanks in advance to anyone who can help me out.
cluedOut

Got a situation I have to find my way around, but I want to know if there even is a way around:
Say I have an XML document that has the following
<student no="1">Baxter</student>
The xsd schema allows the integers 1 through to 9 for the 'student no' attribute and the strings, say Baxter, Erin, Katie.... for the 'Student' element content.
I've got a handle on the enumeration for this, however what I really want is for the enumerations to be linked, so to speak.
Like this, if the xml document were to have 'student no' as 1, then the only string that can be inserted as 'student' element content is 'Baxter'
I.e This is valid :
<student no="1">Baxter</student>
This will not be valid:
<student no="1">Somename</student>
Thanks in advance to anyone who can help me out.

cluedOut
cluedOut
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
That is called co-occurence constraint and it is not supported by XML Schema. Possible options are:
- perform the check at application level
- use Schematron embedded in XML Schema (oXygen supports that)
- use Relax NG or Relax NG with embedded Schematron rules (oXygen supports also that)
Best Regards,
George
That is called co-occurence constraint and it is not supported by XML Schema. Possible options are:
- perform the check at application level
- use Schematron embedded in XML Schema (oXygen supports that)
- use Relax NG or Relax NG with embedded Schematron rules (oXygen supports also that)
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service