Adding attribute for root-type in derived schema
Posted: Mon Dec 02, 2013 3:52 pm
Hi,
I have two document types:
1. for generic documents (a specialization of dita)
2. for specifications
In the first one for instance the topic and section elements (and several others) have the attribute audience. I realizes this by deriving these types from a common base type containing these attributes. Since the complete xsd is quite large I've split it into several files.
Now for my specifications I want to extend the xsd for generic documents. One part of this is adding a diff attribute for every element that has the audience attribute. I'm doing this by importing the xsd with xs:redefine:
This works fine so far but I get following warning:
Now I'm wondering how else I can achieve the desired extension of the base type!? AttributeGroups would work as well but I found no way to extend these. Putting the complete base schema in one file works but it's no real option since the file gets too large to maintain confortably.
If there is no other way to do this in a xsd conform way: Is it at least possible to suppress the saxon warning?
Thanks for any ideas.
Patrik
I have two document types:
1. for generic documents (a specialization of dita)
2. for specifications
In the first one for instance the topic and section elements (and several others) have the attribute audience. I realizes this by deriving these types from a common base type containing these attributes. Since the complete xsd is quite large I've split it into several files.
Now for my specifications I want to extend the xsd for generic documents. One part of this is adding a diff attribute for every element that has the audience attribute. I'm doing this by importing the xsd with xs:redefine:
Code: Select all
<xs:redefine schemaLocation="genericbook.xsd">
<xs:complexType name="BaseType">
<xs:complexContent>
<xs:extension base="BaseType">
<xs:attribute ref="diff"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>
Code: Select all
Saxon-EE 9.5.0.2
The redefined complex type was found, but not in the schema document referenced by the schemaLocation attribute of the containing <xs:redefine> element. This is not allowed by the XSD specification. However, Saxon does not currently enforce this rule.
If there is no other way to do this in a xsd conform way: Is it at least possible to suppress the saxon warning?
Thanks for any ideas.
Patrik