You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by johnli121 <jo...@gmail.com> on 2006/03/03 13:20:41 UTC
xmlbeans throws exception, is it right?
Hi,
When I XmlBeans.compileXsd below schema, xmlbeans throw exception. But I
think this schema is OK, please help to check it. What's wrong?
I have tried it under xmlbeans 2.0.0 and 2.1.0.
Error message:
fixed.xsd:0: error: e-props-correct.2: The 'Test@http://www.world.com'
element fixed value '' is not a valid value for
'countryItemType@http://www.world.com'
My test schema:
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:self="http://www.world.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.world.com">
<complexType name="stringItemType" final="extension">
<simpleContent>
<extension base="string">
<attribute name="date" type="xsd:string" use="required"/>
<anyAttribute namespace="##other" processContents="lax"/>
</extension>
</simpleContent>
</complexType>
<complexType name="countryItemType">
<simpleContent>
<restriction base="self:stringItemType">
<length value="0" fixed="true"/>
</restriction>
</simpleContent>
</complexType>
<element name="Test" type="self:countryItemType" fixed="" nillable="true"
id="int-Test"/>
</schema>
There are two way to work around it,
1.) <attribute name="date" type="xsd:string" use="required"/> change from
"required" to "optional".
2.) <element name="Test" type="self:countryItemType" fixed=""
nillable="true" id="int-Test"/> delete fixed=""
But my problem is, this snippet is from a released Schema, so it's
difficult(if not impossible) to modify it. And first of all, I want to make
sure it's a issue of xmlbeans or that released Schema.
Thanks,
John Li
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org