You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by john <jo...@blueyonder.co.uk> on 2002/08/23 00:30:21 UTC
DOMSources from Nodes
Can anyone help me with this:
I send a document to a server using SOAP. The SOAP envelope contains some
XML data and an XSL stylesheet. I locate the Element <xsl:stylesheet ...>
and construct a DOMSource with it - xslSource.
I remove that Element from the envelope. Then find the root element of my
data <records> and construct a DOMSourse with that - xmlSource.
I construct another object with the sources which transforms the xml in the
usual way
Transformer transformer = transformerFactory.newTransformer( xslSource ) ;
transformer.transform( xmlSource, domResult ) ;
I get :
javax.xml.transform.TransformerException: java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.transformNode
at org.apache.xalan.transformer.TransformerImpl.transform
....
....
The strange part is that if I serialize the DOMSources and write them to a
file, then read them in again as separate Documents and create DOMSources
with them, everything works as intended. So I'm reasonably confident my XSL
is OK. I thought it might be something to do with the transformer not being
able to find the Root of the document. But I have tried the first line in my stylesheet as
is:
<xsl:template select="//records" />
&
<xsl:template select="records" />
and the result is the same.
I am using xalan 2.2 and xerces 1.4.4 with JDK 1.3.1 on Linux at home and
Solaris in college.
Where am I going wrong?
Thanks in advance
John
j.ollier@cs.ucl.ac.uk