I have the following code below in my Servlet, but when IE hits the page, it returns a blank html page. If I use the response.getOutputStream() directly in the StreamResult constructor, the page loads fine. What am I missing?
response is an instance of HttpServletResponse and xsl is an instance of Transformer from XSLTC TransformerFac...
I googled for this for a while but can't seem to find it and it should be easy. I want to append a CR to then end of an XML file that I am creating with a Transformer. Is there a way to do this>
I tried the following but this resulted in a blank file?
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.set...
I'm using the javax.xml.transform.Transformer class to perform some XSLT translations, like so:
TransformerFactory factory = TransformerFactory.newInstance();
StreamSource source = new StreamSource(TRANSFORMER_PATH);
Transformer transformer = factory.newTransformer(source);
StringWriter extractionWriter = new StringWriter();
String xml ...
I'm working on filter that should transform an output with some stylesheet. Important sections of code looks like this:
PrintWriter out = response.getWriter();
...
StringReader sr = new StringReader(content);
Source xmlSource = new StreamSource(sr, requestSystemId);
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transforme...
Hi all,
I have the following XSLT 2.0 template:
<xsl:template name="t1">
<xsl:variable name="totalpos" as="xsd:double" select="$currentTotal"/>
..
I am struggling to programmatticaly provide currentTotal as a parameter to the transformer, like this:
transformer.setParameter("currentTotal", new Double("100"))
.. but without any posi...
Hi,
I'm using javax.xml.transform.Transformer class to transform the DOM source into XML string. I have some empty elements in DOM tree, and these become one tag which I don't want.
How do I prevent <sampletag></sampletag> from becoming <sampletag/>?
...
Hello,
I have a problem using a transformer to generate an XML document.
The incoming org.w3c.dom.Document has the entity codes correct:
®
However, once the Document is transformed the ampersand is encoded:
&#174;
I was expecting ampersands followed by a # to have been respected, but I guess perhaps this is correct behav...
I have an application which I wrote which used to work perfectly fine. There is new requirement that all data needs to be encrypted now, so I implemented encryption by making all my core data fields type transformable and writing custom transformers for each data type which encrypts/decrypts each element of data as it is written/read fro...