xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Control output of CDATA sections
- From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
- To: "Hughes, Rob" <hughes AT fgm.com>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Control output of CDATA sections
- Date: Fri, 8 Dec 2006 12:34:03 -0800
If the receiving side of the pipe can't be fixed, a work-around would be to use the StreamingStaxSerializer class in combination with a StAX implementation such as woodstox. It converts XOM's CDATASection objects to StAX character events, which correspond to XOM text nodes. A benefitial side effect of doing so with woodstox would be that serialization is at least twice as fast as with the normal nu.xom.Serializer (measured using no pretty printing).
See http://dsd.lbl.gov/nux/api/nux/xom/io/StreamingSerializer.html
Example usage:
nu.xom.Document doc = ...
OutputStream out = ...
XMLStreamWriter writer = XMLOutputFactory.newInstance ().createXMLStreamWriter(out, "UTF-8");
StreamingSerializer ser = new StreamingSerializerFactory ().createStaxSerializer(writer);
ser.write(doc);
out.close();
Wolfgang.
On Dec 8, 2006, at 6:51 AM, Hughes, Rob wrote:
Is there a property on the XOM serializer to instruct it not to output
CDATA sections?
I have an application where the XML instance documents are not allowed
to contain CDATA sections. As a result, it is important for me control
this aspect of the serializer.
--Thank You, Rob
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
-
[XOM-interest] Control output of CDATA sections,
Hughes, Rob, 12/08/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Elliotte Harold, 12/08/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Hughes, Rob, 12/11/2006
- Re: [XOM-interest] Control output of CDATA sections, Randall R Schulz, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Michael Kay, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Elliotte Harold, 12/11/2006
- Re: [XOM-interest] Control output of CDATA sections, Randall R Schulz, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Elliotte Harold, 12/11/2006
- Re: [XOM-interest] Control output of CDATA sections, Steve Loughran, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Hughes, Rob, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Wolfgang Hoschek, 12/08/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Hughes, Rob, 12/11/2006
- Re: [XOM-interest] Control output of CDATA sections, Wolfgang Hoschek, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Hughes, Rob, 12/11/2006
-
Re: [XOM-interest] Control output of CDATA sections,
Elliotte Harold, 12/08/2006
Archive powered by MHonArc 2.6.24.