XML Schema with XInclude - xml:base attribute
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 83
- Joined: Fri Sep 17, 2004 10:53 am
- Location: Prague, the Czech Republic, Europe
XML Schema with XInclude - xml:base attribute
Hello!
I have a problem. I have XSD and XML valid to this shema. I want to use XInclude in XML to include "column" element, which is root element in other XML. XML processor (default in oXygen 7.0) does inclusion, but claims:
Description: E cvc-complex-type.3.2.2: Attribute 'xml:base' is not allowed to appear in element 'column'.
This is because XML processor automatically adds attribute called "xml:base" to the resulted XML document. Well, what should I do in XML Schema and XML to be again valid? In other words some example of two XML (one is included into other) and one XSD is welcome.
Element definition in my XSD is defined as follows:
<xs:element name="column">
<xs:complexType mixed="false">
<xs:attribute name="xmlName" use="required" type="xs:NCName"/>
<xs:attribute name="sqlName" use="required" type="xs:NCName"/>
<xs:attribute name="globalVariableName"/>
<xs:attribute name="charsetName"/>
<xs:attribute name="base" type="xs:anyURI" form="qualified" />
</xs:complexType>
</xs:element>
This XSD is valid. Root elemnt of XML has an attribute xmlns:xi="http://www.w3.org/2001/XInclude"
Can You help me, please?
Stepan
P.S. When I turn off validation in J2SE 1.5.0, fragment is included as expected.
I have a problem. I have XSD and XML valid to this shema. I want to use XInclude in XML to include "column" element, which is root element in other XML. XML processor (default in oXygen 7.0) does inclusion, but claims:
Description: E cvc-complex-type.3.2.2: Attribute 'xml:base' is not allowed to appear in element 'column'.
This is because XML processor automatically adds attribute called "xml:base" to the resulted XML document. Well, what should I do in XML Schema and XML to be again valid? In other words some example of two XML (one is included into other) and one XSD is welcome.
Element definition in my XSD is defined as follows:
<xs:element name="column">
<xs:complexType mixed="false">
<xs:attribute name="xmlName" use="required" type="xs:NCName"/>
<xs:attribute name="sqlName" use="required" type="xs:NCName"/>
<xs:attribute name="globalVariableName"/>
<xs:attribute name="charsetName"/>
<xs:attribute name="base" type="xs:anyURI" form="qualified" />
</xs:complexType>
</xs:element>
This XSD is valid. Root elemnt of XML has an attribute xmlns:xi="http://www.w3.org/2001/XInclude"
Can You help me, please?
Stepan
P.S. When I turn off validation in J2SE 1.5.0, fragment is included as expected.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hello Stepan,
You need first to import the schema for the xml namespace like:
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
if you place xml.xsd locally or
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
Then you can just add a reference to the xml:base attribute like
<xs:attribute ref="xml:base"/>
Best Regards,
George
You need first to import the schema for the xml namespace like:
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
if you place xml.xsd locally or
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
Then you can just add a reference to the xml:base attribute like
<xs:attribute ref="xml:base"/>
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