users@jaxb.java.net

org.xml.sax.SAXParseException: unexpected root element

From: Yang Yue Xiang <yxyang_at_jwcc.net>
Date: Tue, 27 Jan 2004 18:24:13 +0800

Hello,

I am using jaxb-1.0.2. I met following errors during unmarshalling.
Basicaly, i have following following element defined in schema file.
'iq' element has two subelements, oe is query, the other is anyType.
The <xjc:dom/> is used in the schema. Actually, i use xjc compile the
xsd file and get the java codes. Also, i found the .java file is correct
related to the dom parts. However, when i try to unmarshal an element,
following error happened.



<xs:element name='iq'>
    <xs:complexType>
     <xs:sequence>

     <xs:element ref="privacy:query" minOccurs='0' maxOccurs='1'>
      <xs:annotation>
       <xs:appinfo>
        <jxb:property name="privacyquery">
        </jxb:property>
       </xs:appinfo>
      </xs:annotation>
     </xs:element>

     <xs:element name="apploading" minOccurs='0' maxOccurs='1'>
      <xs:complexType>
       <xs:sequence>
        <xs:any maxOccurs="1" processContents="skip">
          <xs:annotation>
          <xs:appinfo>
            <xjc:dom />
          </xs:appinfo>
          </xs:annotation>
        </xs:any>
       </xs:sequence>
      </xs:complexType>
     </xs:element>

    </xs:sequence>
   </xs:complexType>
</xs:element>


-----Error Message -----

> receivedMessageFromC2SConnector() is called with msg = <iq xmlns="jabber:client" type="get" id="gaim86d81dd4" to="172.16.2.84"><query xmlns="http://jabber.org/protocol/disco#items"></query></iq>
> 2004-01-27 16:38:37,705 INFO [STDOUT] DefaultValidationEventHandler: [ERROR]: Unexpected element {http://jabber.org/protocol/disco#items}:query
> Location:
> 2004-01-27 16:38:37,741 ERROR [STDERR] javax.xml.bind.UnmarshalException: Unexpected element {http://jabber.org/protocol/disco#items}:query


Notes: in the error messages, i expected that "<query
xmlns="http://jabber.org/protocol/disco#items"></query>" will be
unmarshalled as an dom node.

Regards
yang



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net