It is not weird. And there is nothing weird with XMLBeans.
The XMLBeans error tells you exactly what the problem is.
If you encounter an error from XMLBeans, I'd advise you to first look to see 
what you may be doing wrong, instead of thinking XMLBeans is doing something 
wrong.
In this case, your schema is invalid. You cannot have an xs:any in an xs:all 
group, only xs:element (and xs:annotation). An xs:all group is used to indicate 
that elements should appear in any order, but no more than once each. It can 
only contain element declarations and references.
- Wing Yew
 
  _____  

From: Sebastien Dionne [mailto:survivan...@gmail.com] 
Sent: Wednesday, December 30, 2009 9:30 AM
To: user@xmlbeans.apache.org
Subject: Re: jaxb to xmlbeans : xmlbeans fail on xs:any


it wierd.. even jaxb is not able to recompile it.




2009/12/30 Sebastien Dionne <HYPERLINK 
"mailto:survivan...@gmail.com"survivan...@gmail.com>


hello

I used jaxb to generate schema from java source and now I'm trying to 
regenerate java with xmlbeans but it failed on this line

<xs:any processContents="lax" maxOccurs="unbounded"/>

if I remove this line it will compile.

there is something wierd with xmlbeans ?


<xs:complexType name="DeviceType">
    <xs:all>
      <xs:element name="deviceType" type="xs:string"/>
      <xs:element name="friendlyName" type="xs:string"/>
      <xs:element name="manufacturer" type="xs:string"/>
      <xs:element name="manufacturerURL" type="xs:string" minOccurs="0"/>
      <xs:element name="modelDescription" type="xs:string" minOccurs="0"/>
      <xs:element name="modelName" type="xs:string"/>
      <xs:element name="modelNumber" type="xs:string" minOccurs="0"/>
      <xs:element name="modelURL" type="xs:string" minOccurs="0"/>
      <xs:element name="serialNumber" type="xs:string" minOccurs="0"/>
      <xs:element name="UDN" type="xs:string"/>
      <xs:element name="UPC" type="xs:string" minOccurs="0"/>
      <xs:element name="iconList" type="tns:IconListType" minOccurs="0"/>
      <xs:element name="serviceList" type="tns:ServiceListType" minOccurs="0"/>
      <xs:element name="deviceList" type="tns:DeviceListType" minOccurs="0"/>
      <xs:element name="presentationURL" type="xs:string" minOccurs="0"/>
      <xs:any processContents="lax" maxOccurs="unbounded"/>
    </xs:all>
    <xs:anyAttribute namespace="##other" processContents="skip"/>
  </xs:complexType>

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] XmlBeans compile failed:
 xml ErrorLoading schema file C:\test\upnp-xsd-xmlbeans-jar\src\main\xsd\device.
xsd
xml ErrorC:\test\upnp-xsd-xmlbeans-jar\src\main\xsd\device.xsd:43:7: error: cvc-
complex-type.2.4a: Expected element 'elem...@http://www.w3.org/2001/XMLSchema' i
nstead of 'a...@http://www.w3.org/2001/XMLSchema' here in element 
a...@http://www.
HYPERLINK "http://w3.org/2001/XMLSchema"; \nw3.org/2001/XMLSchema
xml ErrorLoading config file C:\test\upnp-xsd-xmlbeans-jar\src\main\xsdconfig\de
vice.xsdconfig






-- 
-------------
A+

Sébastien.

Vous pouvez me suivre sur Twitter / You can follow me on Twitter : 
http://twitter.com/survivant

Reply via email to