[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Created: (XMLBEANS-304) Cannot instantiate type-specific
From:       "Hacking Bear (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2006-12-05 21:48:23
Message-ID: 19335403.1165355303306.JavaMail.jira () brutus
[Download RAW message or body]

Cannot instantiate type-specific XmlBean from DOM
-------------------------------------------------

                 Key: XMLBEANS-304
                 URL: http://issues.apache.org/jira/browse/XMLBEANS-304
             Project: XMLBeans
          Issue Type: Bug
          Components: Binding
    Affects Versions: Version 2.2.1
            Reporter: Hacking Bear


I couldn't get the XmlObject.Factory.parse(Node) to create type-specific XMLBean. The \
test code is

public class DOM2BeanTest {
    public static void main(String[] args) throws Exception {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInsta
nce();
        DocumentBuilder db = dbf.newDocumentBuilder();

        File file = new File("test/testshib-metadata.xml"); // SAML2.0 Metadata file
        Document doc = db.parse(file);
        XmlObject xbean = XmlObject.Factory.parse(doc.getDocumentElement());
        XmlObject xbean2 = XmlObject.Factory.parse(file);
        System.out.println("Type of xbean: "+xbean.getClass());
        System.out.println("Type of xbean2: "+xbean2.getClass());
    }
}

Type of xbean: class org.apache.xmlbeans.impl.values.XmlAnyTypeImpl
Type of xbean2: class \
x0Metadata.oasisNamesTcSAML2.impl.EntitiesDescriptorDocumentImpl

xbean2 is of correct user-derived type EntitiesDescriptorDocument but the xbean, \
parsed from a DOM Node, is always of generic type XmlAnyType.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: \
                http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic