Hi all!
I have always been using the "org.apache.xml.serialize" package to output my SAX stream.
Until today, I was using the Method.HTML output format. I tried to switch to Method.HTML, but since the script tags are not serialized as CDATA (I have lots of inline dynamic scripts), it makes it unusable.
I tried everything :
String[] elements = {"script", "style"};
OutputFormat lOutputFormat = new OutputFormat(Method.XHTML, null, false);
lOutputFormat.setDoctype("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");
lOutputFormat.setOmitXMLDeclaration(false);
lOutputFormat.setOmitDocumentType(false);
lOutputFormat.setPreserveSpace(true);
lOutputFormat.setNonEscapingElements(elements);
lOutputFormat.setCDataElements(elements);
SerializerFactory lSerializerFactory = SerializerFactory.getSerializerFactory(lOutputFormat.getMethod());
Serializer lSerializer = lSerializerFactory.makeSerializer(lOutputFormat);
lSerializer.setOutputByteStream(iOutputStream);
Anybody has an idea?
thanks,
v-o
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
