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 Andy Hay <an...@axa-insurance.co.uk> on 2007/02/07 15:27:24 UTC

NPE in DOMSource transformation using xsl:copy-of

We're currently working on moving from Xalan 2.3.1 to Xalan 2.7.0 and have
encountered a problem with xsl:copy-of.  Using StreamSource transformations,
the code behaves as expected.  However when using a DOMSource transformation
(which we mostly do) a NullPointerException is thrown.  The transformation
is exited at the point reached without any exception being thrown. 
Unfortunately the resulting XML is missing nodes that had not been reached
in the transformation.  

The XSL stylesheet is very similar to many others that we have, with the
template causing the problem being :-

   <xsl:template match="/WorkingDocument/Notes/Request" mode="build">
       <Request>
         <xsl:copy-of select = "Message"/>
         <xsl:copy-of select = "Action"/>			
         <xsl:copy-of select = "NPQuote"/>
         ......
         Some manipulation of data in the Request node
         .......
       </Request>
   </xsl:template>

The node /WorkingDocument/Notes/Request/NPQuote does not exist.  Xalan
outputs a warning message "SystemId Unknown; Line #37; Column #37;
java.lang.NullPointerException" but does not throw an Exception.  No node
after the completion of the previous line appears in the resulting XML.

Is this now expected behaviour within a DOMSource transformation ?  

I've tried this in Xalan 2.7.0 unsuccessfully and also recreated the same
problem this week in Xalan 2.7.1.

Thanks

Andy

-- 
View this message in context: http://www.nabble.com/NPE-in-DOMSource-transformation-using-xsl%3Acopy-of-tf3187317.html#a8846364
Sent from the Xalan - J - Users mailing list archive at Nabble.com.


Re: NPE in DOMSource transformation using xsl:copy-of

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Andy.

Andy Hay <an...@axa-insurance.co.uk> wrote on 2007-02-07 09:27:24 AM:
>    <xsl:template match="/WorkingDocument/Notes/Request" mode="build">
>        <Request>
>          <xsl:copy-of select = "Message"/>
>          <xsl:copy-of select = "Action"/> 
>          <xsl:copy-of select = "NPQuote"/>
>          ......
>          Some manipulation of data in the Request node
>          .......
>        </Request>
>    </xsl:template>
> 
> The node /WorkingDocument/Notes/Request/NPQuote does not exist.  Xalan
> outputs a warning message "SystemId Unknown; Line #37; Column #37;
> java.lang.NullPointerException" but does not throw an Exception.  No 
node
> after the completion of the previous line appears in the resulting XML.
> 
> Is this now expected behaviour within a DOMSource transformation ? 

No, this is not expected behaviour for DOMSource, however I was unable to 
reproduce the problem from your description of it.  May I ask you to open 
a bug report in Jira supplying a complete stylesheet and input document, 
as well as any Java driver program necessary to reproduce the problem, so 
that we will be able to investigate further?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com