Xsl cdata-section-elements output property with Xalan-J?

That is what i'd like to do and your solution works. I thought that I could use the cdata-section-elements here to achieve the same thing. Using the cdata-section-elements approach works when I apply the above xsl to the above xml in an XML tool, I get the desired result.

Only when I use the above code to apply the xsl do I not get the expected result – hydeph Jun 30 '09 at 19:03.

It works for me, with Xalan 2.7.1, not sure why it doesn't work for you. I simplified the code fragment, but I don't think there's any functional difference, but try it anyway: import javax.xml.transform. Source; import javax.xml.transform.

Transformer; import javax.xml.transform. TransformerFactory; import javax.xml.transform.stream. StreamResult; import javax.xml.transform.stream.

StreamSource; import org.apache.xalan. Version; public class Transform { public static void main(String args) throws Exception { System.out. Println(Version.getVersion()); Source xslSource = new StreamSource(Transform.class.

GetResourceAsStream("test. Xsl")); Source xmlSource = new StreamSource(Transform.class. GetResourceAsStream("test.

Xml")); Transformer transf = TransformerFactory.newInstance(). NewTransformer(xslSource); StreamResult transformedXml = new StreamResult(System. Out); transf.

Transform(xmlSource, transformedXml); } } Output is: Xalan Java 2.4.1 What is odd is that Xalan's Version.getVersion() returns 2.4.1, not 2.7.1, and I'm definitely using 2.7.1 here.

1) I guess it turns out I haven't been using Xalan 2.7.1. The code in skaffman's answer made me think to check Version.getVersion() and the signature is "XL TXE Java 1.0.7". This appears to be the default when using IBM java IBM J9 VM (build 2.4, J2RE 1.6.0).2) I switched from using StAXSource and StAXResult to using StreamSource and StreamResult and it works fine (like in skaffman's answer).

Specifically the change from StAXResult to StreamResult is what worked. Using StAXSource with StreamResult works too.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions