All elements allowed as children except one ???
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Tue Sep 26, 2006 8:05 pm
All elements allowed as children except one ???
Is it possible to define a complex type that can contain any element from the local namespace except for one specified element. I have a schema with about 1500 elements of the same type. I am trying to define another element that can contain any number of the other elements in any order except for one or two specific elements. I cannot find a way to define this is xsd. Thank you for you help. 

-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
No, you cannot do that in XML Schema.
You can allow all the elements and add a Schematron rule to report an error if one of the elements you do not want to appear is present.
Relax NG schema has an except pattern that does exactly what you want.
oXygen has support for both XML Schema with Schematron embedded rules (and can validate against such a schema) and for Relax NG.
Best Regards,
George
No, you cannot do that in XML Schema.
You can allow all the elements and add a Schematron rule to report an error if one of the elements you do not want to appear is present.
Relax NG schema has an except pattern that does exactly what you want.
oXygen has support for both XML Schema with Schematron embedded rules (and can validate against such a schema) and for Relax NG.
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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