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 '[EMAIL PROTECTED]://www.world.com' element fixed value '' is not a valid value for '[EMAIL PROTECTED]://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

Reply via email to