[jdom-interest] jdom & xalan

Paul Walk p.walk at unl.ac.uk
Tue Mar 6 08:58:43 PST 2001


I have also experienced this (or a similar) problem, using
the 'birds.xml' and 'birds.xsl' files from the
'SimpleTransform' example in the Xalan-j2.0.0 distribution.

Having prepared the Transformer object and loaded it with a
style sheet like this:
<code>
	TransformerFactory tFactory =
TransformerFactory.newInstance();
	Transformer transformer = tFactory.newTransformer (new
StreamSource(new File("birds.xsl")));
</code>

This example gives the correct, transformed output:
<code>
	transformer.transform(new StreamSource(new
File("birds.xml")),new StreamResult(System.out));
</code>

Whereas this does not:
<code>
	SAXBuilder builder = new SAXBuilder(false);
        DOMSource domSource = new DOMSource(new
DOMOutputter().output(builder.build(new
File("birds.xml"))));
        transformer.transform(domSource,new
StreamResult(System.out));
</code>

Any ideas, anyone?

Paul




Peter Courcoux wrote:
> 
> Hi all,
> 
> Can anyone answer this for me?
> 
> If I pass an xml document created by the jdom XMLOutputter class to xalan
> 2.0.0 with the appropriate stylesheet, I get the expected html output to an
> outputStream. However, if I use the jdom DOMOutputter to output the same
> jdom document and pass the created DOM object to xalan as a DOMSource I get
> xml output. Why do I not get the same output either way?
> 
> Thanks for any help.
> 
> Peter Courcoux
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

----------------------------
Paul Walk
Intranet Services
University of North London

Email:  p.walk at unl.ac.uk
Telephone (Direct Dial):        020 7753 3288
Telephone (Switchboard):        020 7607 2789 ext. 2690
----------------------------



More information about the jdom-interest mailing list