xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Serialize selected elements to a Writer.
- From: "Michael Kay" <mike AT saxonica.com>
- To: "'Elliotte Harold'" <elharo AT metalab.unc.edu>, "'David Bullock'" <db AT dawnbreaks.net>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Serialize selected elements to a Writer.
- Date: Sat, 14 Oct 2006 10:01:47 +0100
If you want to do this with Saxon, it's something like:
Configuration config = new Configuration();
SerializerFactory sfactory = config.getSerializerFactory();
Result result = new StreamResult(myWriter);
Properties props = new Properties();
props.setProperty("method", "xml");
props.setProperty("encoding", "whatever");
Receiver serializer = sfactory.getReceiver(
result, config.makePipelineConfiguration(), props);
new DocumentWrapper(xomDocument, "", config).copy(serializer,
NodeInfo.ALL_NAMESPACES, false, 0);
Just take care that the encoding used by the Writer is compatible with the
encoding set for the serializer.
Michael Kay
http://www.saxonica.com/
-
[XOM-interest] Serialize selected elements to a Writer.,
David Bullock, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Elliotte Harold, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
John Cowan, 10/16/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
David Bullock, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Elliotte Harold, 10/13/2006
- Re: [XOM-interest] Serialize selected elements to a Writer., Michael Kay, 10/14/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
David Bullock, 10/16/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Ed Davies, 10/16/2006
- Re: [XOM-interest] Serialize selected elements to a Writer., Michael Kay, 10/16/2006
- Re: [XOM-interest] Serialize selected elements to a Writer., Tatu Saloranta, 10/17/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Ed Davies, 10/16/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Elliotte Harold, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
David Bullock, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
John Cowan, 10/16/2006
- Re: [XOM-interest] Serialize selected elements to a Writer., Elliotte Harold, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Wolfgang Hoschek, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Wolfgang Hoschek, 10/13/2006
- Re: [XOM-interest] Serialize selected elements to a Writer., Tatu Saloranta, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Wolfgang Hoschek, 10/13/2006
-
Re: [XOM-interest] Serialize selected elements to a Writer.,
Elliotte Harold, 10/13/2006
Archive powered by MHonArc 2.6.24.