You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Howard Goldberg <HG...@cstlink.com> on 2000/07/25 08:25:50 UTC

derividby extension bug?

The following schema

<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<xsd:complexType name='t1' base='xsd:string' derivedBy='extension'>
	<xsd:attribute name='a1' use='optional'/>
</xsd:complexType>

<xsd:complexType name='t2' base='t1' derivedBy='restriction'>
	<xsd:attribute name='a1' use='required'/>
</xsd:complexType>

<xsd:element name='s1'>
	<xsd:complexType>
	<xsd:element name='e1' type='t2'/>
	</xsd:complexType>
</xsd:element>
</xsd:schema>

for the following instance

<?xml version="1.0" encoding="UTF-8"?>
<s1 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
	   xsi:noNamespaceSchemaLocation='derived.xsd'>
	<e1 a1='v1'/>
</s1>
	

gives the following error:


D:\neofax\schema\pages>java dom.DOMWriter -v dtest.xml
dtest.xml:
[Error] dtest.xml:3:49: Schema error: Invalid child 'attribute' in
complexType :
 't2', because it restricts another complexSimpleType.
[Error] dtest.xml:3:49: Schema error: In complexType t2, base type has
simpleTyp
e content and derivation method is 'restriction', can't have any attribute
child
ren at all.
<?xml version="1.0" encoding="UTF-8"?>
<s1 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:noNamespaceSchemaL
ocation="derived.xsd">
        <e1 a1="v1"></e1>
</s1>

Is this a limitation of Schema or a parser bug?

Thanks,
Howard Goldberg
 <<Howard S Goldberg MD.vcf>>