You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ho...@de.ibm.com on 2001/03/06 11:14:34 UTC
deriving attributes from one namespace to another
Hi,
I've some trouble with attributes and fixed values and I hope someone can
help me out. Maybe it is not allowed what I'm doing. All I know is that it
does not work.
I use the following definitions and declarations:
In namespace 'test2'
<complexType name="t">
<attribute name="a" type="string" use="required"/>
</complexType>
In namespace 'test'
<element name="e">
<complexType>
<simpleContent>
<restriction base="test2:t">
<simpleType>
<list itemType="long"/>
</simpleType>
<attribute name="a" type="string" use="fixed"
value="fixedValue"/>
</restriction>
</simpleContent>
</complexType>
</element>
<element name="root">
<complexType>
<sequence>
<element ref="test:e"/>
</sequence>
</complexType>
</element>
I'm using a xml document with the following element:
<root>
<e>1 2 3 4 5</e>
</root>
If I try to validate my document xerces returns an error '[Error]
test.xml:3:6: Attribute "a" is required and must be specified for element
type "e".'
If I move the type 't' into namespace 'test', the validation succeeds.
Am I doing something wrong or is it a bug in xerces?
Thanks!
Holger