Extending and adding attributes
This should cover W3C XML Schema, Relax NG and DTD related problems.
Extending and adding attributes
I am trying to extend a complex type and add some additional attributes.
<xs:complexType name="EntityType" abstract="true">
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="href" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:complexType name="EdoType">
<xs:complexContent >
<xs:extension base="EntityType"/>
</xs:complexContent>
<xs:attribute name="X-href" type="xs:anyURI"/>
</xs:complexType>
Oxygen complains about the attribute being invalid or misplaced.
<xs:complexType name="EntityType" abstract="true">
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="href" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:complexType name="EdoType">
<xs:complexContent >
<xs:extension base="EntityType"/>
</xs:complexContent>
<xs:attribute name="X-href" type="xs:anyURI"/>
</xs:complexType>
Oxygen complains about the attribute being invalid or misplaced.
Hi,
That is a basic error. If you use complexContent as a child if complexType you cannot have other elements following complexContent. You should place the attribute inside the xs:extension element as below:
Best Regards,
George
That is a basic error. If you use complexContent as a child if complexType you cannot have other elements following complexContent. You should place the attribute inside the xs:extension element as below:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="EntityType" abstract="true">
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="href" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:complexType name="EdoType">
<xs:complexContent >
<xs:extension base="EntityType">
<xs:attribute name="X-href" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
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