|
|
22 Jul 2008 16:31:54 GMT, /Stefan Ram/:
Another way to write XML with pre-1.6-Java:
com.sun.org.apache.xml.internal.serialize.XMLSerializer serializer =
new com.sun.org.apache.xml.internal.serialize.XMLSerializer
( fileOutputStream, outputFormat);
serializer.startDocument();
{ serializer.startElement("", "example", "example",
new com.sun.org.apache.xml.internal.serializer.
AttributesImplSerializer() );
{ final char[] data = "test text" . toCharArray();
serializer.characters( data, 0, data.length );
serializer.endElement( "", "example", "example" ); }
serializer.endDocument(); }}}
Here's more standard way of doing it without requiring
implementation specific classes (works with Java 1.4):
http://mail-archives.apache.org/mod_mbox/xml-xalan-j-users/200801.mbox/%3c47972921.1020300@xxxxxxxxxxxx%3e
--
Stanimir
|
|