Only DOM Level 2 core is currently supported.

On 4/14/06, Alistair Young <[EMAIL PROTECTED]> wrote:
> Well, I managed to cobble together DOM3 support but it's not
> particularly nice!
>
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> // MUST be TRUE or can't get back to bean land
> factory.setNamespaceAware(true);
> DocumentBuilder builder = factory.newDocumentBuilder();
>
> // do XMLBeans stuff to get SomeDocument
> SomeDocument someDoc = SomeDocument.Factory.parse( ... );
>
> // Switch to org.w3c.dom.Document - xmlbeans.getDomNode() doesn't
> really seem to give you this
> Document doc = builder.parse(new InputSource(new StringReader
> (someDoc.toString())));
>
> // do DOM3 stuff
> doc.getDocumentElement().setIdAttribute("test", true);
> ... XMLSignature stuff to sign the org.w3c.dom.Document ...
>
> // now switch back to xmlbeans
> someDoc = SomeDocument.Factory.parse(doc.getDocumentElement());
>
> anyone know of an easier way to get DOM3 in xmlbeans?
>
> Alistair
>
>
>
>
> On 14 Apr 2006, at 11:34, Alistair Young wrote:
>
> > I don't suppose this would help - doesn't seem to though:
> >
> > XmlOptions loadOptions;
> > loadOptions.setLoadUseXMLReader(XMLReaderFactory.createXMLReader
> > ("org.apache.xerces.parsers.SAXParser"));
> >
> > I always get back org.apache.xmlbeans.impl.store.Xobj$ElementXobj
> > instead of the xerces equivalent. So it's not possible to use DOM3.
> >
> > Alistair
> >
> >
> > On 14 Apr 2006, at 11:00, Alistair Young wrote:
> >
> >> Does XMLBeans support DOM3? I just get:
> >>
> >> java.lang.RuntimeException: DOM Level 3 Not implemented
> >>
> >> when using DOM3 features such as:
> >>
> >> Element e = (Element)someDocument.getDomNode();
> >> e.setIdAttribute("test", true);
> >>
> >> thanks,
> >>
> >> Alistair
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to