Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] StaX/DOM/SAX-to-XOM bridge

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Dmitry Katsubo <dma_k AT mail.ru>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] StaX/DOM/SAX-to-XOM bridge
  • Date: Tue, 14 Sep 2010 17:11:49 +0200

Dear XOM users!

I want to benefit from quick StaX/DOM/SAX -to- XOM document creation,
but I was not able to locate any way to do so. Actually, my target API I
want to bind with is javax.xml.bind.Marshaller.marshal(), that accepts
javax.xml.transform.Result, org.xml.sax.ContentHandler or
javax.xml.stream.XMLStreamWriter as possible outputs.

Unfortunately, nu.xom.xslt.XOMResult is not visible, so does
nu.xom.XOMHandler. And there is no XMLStreamWriter -to- NodeFactory
bridge. More over I cannot copy XOMHandler to my package, as
Element.setActualBaseURI(), Node.isElement(), etc are not public. Does
it mean I cannot write my own ContentHandler to create XOM document?

The same concerns DOM-to-XOM converters. What I found is only XOM-to-DOM
nu.xom.converters.DOMConverter.

If somebody has ready-to-use adapters, please, share them. At the moment
I found this [1] discussion with this [2] code example, that reads from
javax.xml.stream.XMLStreamReader and creates XOM document.

I would appreciate, if something similar to following code snapshot
would be possible via core XOM:

final nu.xom.xslt.XOMResult result = new nu.xom.xslt.XOMResult(); //
default constructor that creates new NodeFactory() for me
marshaller.marshal(bean, result);
nu.xom.Document doc = result.getDocument();

Any feedback is very welcomed.

[1] https://lists.ibiblio.org/sympa/arc/xom-interest/2005-August/002563.html
[2]
https://lists.ibiblio.org/sympa/arc/xom-interest/2005-September/002617.html

--
With best regards,
Dmitry




Archive powered by MHonArc 2.6.24.

Top of Page