In Xalan, to set the line separator used in transformed documents
http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/TransformerImpl.html
#setOutputProperty
        Source src = new DOMSource(signatureDoc);
        TransformerFactory tranFactory = TransformerFactory.newInstance();
        Transformer tfr = tranFactory.newTransformer();
        
        // Set newline character to \n for all platforms (otherwise will be \r\n on Windows,
        // which will break unit tests)
        tfr.setOutputProperty("{http://xml.apache.org/xalan}line-separator", "\n");
        Result dest = new StreamResult(outputZip);
        tfr.transform(src, dest);
        outputZip.closeEntry();
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment