N
Nick Bassiliades
Hi everybody,
I would like to ask a very specific question about how I can re-define
an enumerated attribute type.
Specifically, I have two XML Schema files.
In file A I have the following attribute group declaration:
*********** file A ******************
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="optional" default="fo">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
*************************************
I file B I want to re-define this attribute in order to include
more constants as possible values for the @kind attribute.
The following produces an error, because the new definition
is not a restriction of the definition found in file A:
***************** file B *********************
<xs:redefine schemaLocation="...file A">
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="required" default="dr">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
<xs:enumeration value="sr"/>
<xs:enumeration value="dr"/>
<xs:enumeration value="df"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
....
*************************************
Notice, that I cannot just change the definition in file A because I
simply do not own it.
How could this be done? How could I extend in a redefinition and not
restrict it?
I have also tried with union but I get the same message (union is an
extension, not a restriction).
Thank you in advance,
Nick Bassiliades
I would like to ask a very specific question about how I can re-define
an enumerated attribute type.
Specifically, I have two XML Schema files.
In file A I have the following attribute group declaration:
*********** file A ******************
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="optional" default="fo">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
*************************************
I file B I want to re-define this attribute in order to include
more constants as possible values for the @kind attribute.
The following produces an error, because the new definition
is not a restriction of the definition found in file A:
***************** file B *********************
<xs:redefine schemaLocation="...file A">
<xs:attributeGroup name="kind.attrib">
<xs:attribute name="kind" use="required" default="dr">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="fo"/>
<xs:enumeration value="lp"/>
<xs:enumeration value="sr"/>
<xs:enumeration value="dr"/>
<xs:enumeration value="df"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
....
*************************************
Notice, that I cannot just change the definition in file A because I
simply do not own it.
How could this be done? How could I extend in a redefinition and not
restrict it?
I have also tried with union but I get the same message (union is an
extension, not a restriction).
Thank you in advance,
Nick Bassiliades