transform collapsing Element 2003-01-31 - By Tim Cronin
I still have a problem.
I'm not trying to Transform xml with XSL
I have a Stylesheet (xsl) loaded into a dom.
I need to write the dom to a string to store it in a DB
I'm using the following to convert to String
public static String toString ( Document doc, boolean indent ) throws TransformerException { StringWriter sw = new StringWriter(); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty("method", "xml"); transformer.setOutputProperty("omit-xml-declaration", "yes"); if (indent) { transformer.setOutputProperty("indent", "yes"); }
transformer.transform(new DOMSource(doc.getDocumentElement()), new StreamResult(sw)); return sw.toString(); }
when I dump the string to system.out the empty <td></td> get collapsed to <td/>
is there a way to stop this?
-----Original Message----- From: Joseph Kesselman [mailto:keshlam@(protected)] Sent: Friday, January 31, 2003 1:05 PM To: xalan-j-users Subject: RE: transform collapsing Element
I've lost track -- are you now OK (set the output to "html" if you don't want xml-style representation of empty elements), or do you still have a problem?
______________________________________ Joe Kesselman / IBM Research
|
|