Require at least one optional unique child?
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 5
- Joined: Tue Sep 18, 2007 8:01 pm
Require at least one optional unique child?
Is there a way to require the parent element (searchRequest) to have at least one child given the following code? Each child element should occur either once or not at all.
<xs:element name="searchRequest">
<xs:complexType>
<xs:all>
<xs:element name="freeText" type="xs:string" minOccurs="0"/>
<xs:element name="before" type="xs:date" minOccurs="0"/>
<xs:element name="after" type="xs:date" minOccurs="0"/>
<xs:element name="status" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="active"/>
<xs:enumeration value="complete"/>
<xs:enumeration value="onhold"/>
</xs:restriction>
<xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="searchRequest">
<xs:complexType>
<xs:all>
<xs:element name="freeText" type="xs:string" minOccurs="0"/>
<xs:element name="before" type="xs:date" minOccurs="0"/>
<xs:element name="after" type="xs:date" minOccurs="0"/>
<xs:element name="status" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="active"/>
<xs:enumeration value="complete"/>
<xs:enumeration value="onhold"/>
</xs:restriction>
<xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
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