You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Massimiliano Romano <ma...@gmail.com> on 2009/02/01 19:56:29 UTC

Document to element

Hello everybody, I'm using xmlbeans to develop wsdl web services.
I have some classes with attributes of type Element, so i need to initialize 
them.

In my xsd file I define this simple type:

<xsd:simpleType name="MySimpleType">
    <xsd:restriction base="xsd:integer">
        <xsd:minInclusive value="1"/>
        <xsd:maxInclusive value="999"/>
    </xsd:restriction>
</xsd:simpleType>

<xsd:element name="MySimpleType"        type="iel:MySimpleType"/>

Then I generate the jar from the xsd

Then, in my java code I write:
    MySimpleTypeDocument sdoc = MySimpleTypeDocument.Factory.newInstance();
    sdoc.setMySimpleType(new BigInteger("1"));
    Element _MySimpleType = 
sdoc.getDomNode().getOwnerDocument().getDocumentElement();

at last line I get a nullPointerException, getOwnerDocument() return NULL.

Could you help me?? Where I was wrong? Thanks

Max



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3798 (20090125) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 3798 (20090125) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com