Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Converting a nu.xom.Document to a org.w3c.dom.Document

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Adam Constabaris <adamc AT unc.edu>
  • To: christophe.marchand AT axyus.com, XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Converting a nu.xom.Document to a org.w3c.dom.Document
  • Date: Wed, 14 Oct 2009 10:34:40 -0400

If you want to write your code against JAXP and XOM classes only, take a
look at

http://www.xom.nu/apidocs/nu/xom/converters/DOMConverter.html

One of the static convert() methods takes a XOM Document and a
DOMImplementation object and returns a W3C DOM object.

IIUC, the easiest (!) implementation-agnostic way to get your JRE's
default DOMImplementation is through an instance of DocumentBuilder,
e.g.

import javax.xml.parsers.*;
import org.w3c.dom.DOMImplementation;

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
DOMImplementation impl = db.getDOMImplementation();

HTH,

AC










On Wed, 2009-10-14 at 15:45 +0200, Christophe Marchand wrote:
> Hi,
>
> is there a way to convert a nu.xom.Document to a DOM Document ?
>
> After a XSL Transform, I need to give the result to Flying Saucer, which
> uses DOM. I would like to avoid a serialization / parsing...
>
> Another question : as transform alway produces a Nodes, there is no way
> to produce html, isn't it ?
>
> Regards,
> Christophe
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>





Archive powered by MHonArc 2.6.24.

Top of Page