You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Sh...@lotus.com on 2001/11/20 15:33:34 UTC

RE: XMLSerializer

Another alternative to using XMLSerializer is to use the identity
transformer that comes with Xalan.  XSLT does transformations - from one
data format to another - including from 'DOM format' into 'stream format'
sort of.

javax.xml.transform.Transformer identityTransformer =
transformerFactory.newTransformer();
identityTransformer.transform(new DOMSource(yourDOMNode), new StreamResult
("file.out"));

This presumes you want to include Xalan in your application, which you
might not otherwise need.  One advantage is that the identity transformer
is pretty well spec'd out in XSLT and JAXP, so it's using a standard that
should be around for a while and other transformers should support as well.

- Shane


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