|
DOM node to type-specific XMLBean error: msg#00077text.xml.xmlbeans.user
[My previous post doesn't seem to be posted. Try again.] Hi, 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. Any idea how to parse the DOM node to XMLBean correctly? Thanks |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Generating partial schemas: 00077, Radu Preotiuc-Pietro |
|---|---|
| Next by Date: | Re: XML Signature and XBean: 00077, Hacking Bear |
| Previous by Thread: | Parsing DOM element to type-specific XMLBeani: 00077, Hacking Bear |
| Next by Thread: | SchemaComponent.getSourceName(): 00077, Artem_Portnoy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |