Restricting Lists
This should cover W3C XML Schema, Relax NG and DTD related problems.
Restricting Lists
I'm trying to restrict the type and number of elements in a list with some attributes.
The generic attribute list looks like this:
<xs:simpleType name="anySimpleList" >
<xs:list itemType="xs:string" />
</xs:simpleType>
<!-- base data type for simple lists with array attributes -->
<xs:complexType name="anyList" abstract="true">
<xs:simpleContent>
<xs:extension base="geometry_schema:anySimpleList" >
<xs:attribute name="ref" type="xs:IDREF" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Then I try to restrict with:
<xs:complexType name="Coordinates">
<xs:simpleContent>
<xs:restriction base="geometry_schema:anyList">
<xs:simpleType>
<xs:list itemType="xs:double"/>
</xs:simpleType>
<xs:minLength value="1"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
And I get:
derivation-ok-restriction.5.2.2.1:
Error for type 'Coordinates'.
The simple content type of this type, 'null', is not a valid restriction of the simple content type of the base, 'anySimpleList'.
@see: http://www.w3.org/TR/xmlschema-1/#deriv ... estriction geom1.xsd AP227_PIPE_057010 line 49 July 14, 2005 3:41:53 PM
Any hint?
The generic attribute list looks like this:
<xs:simpleType name="anySimpleList" >
<xs:list itemType="xs:string" />
</xs:simpleType>
<!-- base data type for simple lists with array attributes -->
<xs:complexType name="anyList" abstract="true">
<xs:simpleContent>
<xs:extension base="geometry_schema:anySimpleList" >
<xs:attribute name="ref" type="xs:IDREF" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Then I try to restrict with:
<xs:complexType name="Coordinates">
<xs:simpleContent>
<xs:restriction base="geometry_schema:anyList">
<xs:simpleType>
<xs:list itemType="xs:double"/>
</xs:simpleType>
<xs:minLength value="1"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
And I get:
derivation-ok-restriction.5.2.2.1:
Error for type 'Coordinates'.
The simple content type of this type, 'null', is not a valid restriction of the simple content type of the base, 'anySimpleList'.
@see: http://www.w3.org/TR/xmlschema-1/#deriv ... estriction geom1.xsd AP227_PIPE_057010 line 49 July 14, 2005 3:41:53 PM
Any hint?
Sorry. Forgot to use BBcode and maybe I'm blind but I can't seem to find the edit post button.
Here is the list:
Here is the restriction:
[/code]
Here is the list:
Code: Select all
<xs:simpleType name="anySimpleList" >
<xs:list itemType="xs:string" />
</xs:simpleType>
<!-- base data type for simple lists with array attributes -->
<xs:complexType name="anyList" abstract="true">
<xs:simpleContent>
<xs:extension base="geometry_schema:anySimpleList" >
<xs:attribute name="ref" type="xs:IDREF" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Code: Select all
<xs:complexType name="Coordinates">
<xs:simpleContent>
<xs:restriction base="geometry_schema:anyList">
<xs:simpleType>
<xs:list itemType="xs:double"/>
</xs:simpleType>
<xs:minLength value="1"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
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