You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Andrew Hay (JIRA)" <xa...@xml.apache.org> on 2007/02/11 22:29:05 UTC

[jira] Created: (XALANJ-2365) NPE in DOMSource transformation using xsl:copy-of

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

                 Key: XALANJ-2365
                 URL: https://issues.apache.org/jira/browse/XALANJ-2365
             Project: XalanJ2
          Issue Type: Bug
          Components: transformation
    Affects Versions: 2.7
         Environment: Windows XP, running Sun Java 1.5 and IBM Java 1.5
            Reporter: Andrew Hay
             Fix For: The Latest Development Code


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.

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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2365) NPE in DOMSource transformation using xsl:copy-of select

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472814 ] 

Henry Zongaro commented on XALANJ-2365:
---------------------------------------

Hi, Andrew.  I was unable to reproduce the problem using a simple driver program that parsed the input into a DOM tree and used a DOMSource for the transformation.  Would it be possible for you to include a Java driver program that demonstrates the problem?  Henry

> NPE in DOMSource transformation using xsl:copy-of select
> --------------------------------------------------------
>
>                 Key: XALANJ-2365
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2365
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: Windows XP, running Sun Java 1.5 and IBM Java 1.5
>            Reporter: Andrew Hay
>             Fix For: The Latest Development Code
>
>         Attachments: copy-of_select.xml, XMLValidatorUpdate.xsl
>
>
> 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.
> I've tried this in Xalan 2.7.0 unsuccessfully and also recreated the same
> problem this week in Xalan 2.7.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


RE: [jira] Commented: (XALANJ-2365) NPE in DOMSource transformation using xsl:copy-of select

Posted by ROHDE Alexander <RO...@eib.org>.
Hello,

I am currently also trying to migrate Xalan from 2.4.1 to 2.7.1. I also experienced,
(very reproducible) that xsl:copy-of seems not to work reliably anymore with the new
version of Xalan. I will do some debugging on it, maybe it is easy to fix.

However, generally speaking, your comment "if anyone still cares to maintain Xalan"
had me shiver. Of course I can see that the last release is more than one year old.
But is development/maintenance completely abandoned? If so is there a migration suggestion?
I tried Saxon, unfortunately their evaluate() implementation differs too much from
xalan:evaluate(), which poses as a show stopper. So this is no option for me at the
moment.

Any suggestions, or maybe some clarification would be greatly appreciated.

Cheers.
Alex

-----Original Message-----
From: Henk Spaan (JIRA) [mailto:xalan-dev@xml.apache.org] 
Sent: Friday 06 February 2009 17:04
To: xalan-dev@xml.apache.org
Subject: [jira] Commented: (XALANJ-2365) NPE in DOMSource transformation using xsl:copy-of select


    [ https://issues.apache.org/jira/browse/XALANJ-2365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671176#action_12671176 ] 

Henk Spaan commented on XALANJ-2365:
------------------------------------

I also got this problem on 2.7.1.
Unfortunately it's not consistent.
After a reboot of the appserver, the problem goes away for a few transforms and then returns. 
So, it's probably a resource problem that's caught by an dysfunctional catch.

Searching the sources I only see a reference to "SystemId Unknown" in DefaultErrorHandler.
DefaultErrorHandler does not throw TransformerExceptions when an error() is issued, so I guess that explains the transformer doesn't fail.
However it does throw an exceptions in error(SaxParseException).

So where is the bug?
No idea.
I'll try a custom errorhandler and cross my fingers that we can reproduce it after a new release in the customer's test environment.

My advice:
A NPE without stacktrace is not informative and there are probably more examples.
Whenever the cause of a TransformerException is a RuntimeException or Error, it should be upgraded to fatal.
The question is just: where do check the exception type.
That's for someone else to decide, if anyone still cares to maintain Xalan.

> NPE in DOMSource transformation using xsl:copy-of select
> --------------------------------------------------------
>
>                 Key: XALANJ-2365
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2365
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: Windows XP, running Sun Java 1.5 and IBM Java 1.5
>            Reporter: Andrew Hay
>             Fix For: The Latest Development Code
>
>         Attachments: copy-of_select.xml, XMLValidatorUpdate.xsl
>
>
> 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.
> I've tried this in Xalan 2.7.0 unsuccessfully and also recreated the same
> problem this week in Xalan 2.7.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


--------------------------------------------------------------------

Les informations contenues dans ce message et/ou ses annexes sont 
reservees a l'attention et a l'utilisation de leur destinataire et peuvent etre 
confidentielles. Si vous n'etes pas destinataire de ce message, vous etes 
informes que vous l'avez recu par erreur et que toute utilisation en est 
interdite. Dans ce cas, vous etes pries de le detruire et d'en informer la 
Banque Europeenne d'Investissement.

The information in this message and/or attachments is intended solely for 
the attention and use of the named addressee and may be confidential. If 
you are not the intended recipient, you are hereby notified that you have 
received this transmittal in error and that any use of it is prohibited. In 
such a case please delete this message and kindly notify the European 
Investment Bank accordingly.
--------------------------------------------------------------------
 


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2365) NPE in DOMSource transformation using xsl:copy-of select

Posted by "Henk Spaan (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671176#action_12671176 ] 

Henk Spaan commented on XALANJ-2365:
------------------------------------

I also got this problem on 2.7.1.
Unfortunately it's not consistent.
After a reboot of the appserver, the problem goes away for a few transforms and then returns. 
So, it's probably a resource problem that's caught by an dysfunctional catch.

Searching the sources I only see a reference to "SystemId Unknown" in DefaultErrorHandler.
DefaultErrorHandler does not throw TransformerExceptions when an error() is issued, so I guess that explains the transformer doesn't fail.
However it does throw an exceptions in error(SaxParseException).

So where is the bug?
No idea.
I'll try a custom errorhandler and cross my fingers that we can reproduce it after a new release in the customer's test environment.

My advice:
A NPE without stacktrace is not informative and there are probably more examples.
Whenever the cause of a TransformerException is a RuntimeException or Error, it should be upgraded to fatal.
The question is just: where do check the exception type.
That's for someone else to decide, if anyone still cares to maintain Xalan.

> NPE in DOMSource transformation using xsl:copy-of select
> --------------------------------------------------------
>
>                 Key: XALANJ-2365
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2365
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: Windows XP, running Sun Java 1.5 and IBM Java 1.5
>            Reporter: Andrew Hay
>             Fix For: The Latest Development Code
>
>         Attachments: copy-of_select.xml, XMLValidatorUpdate.xsl
>
>
> 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.
> I've tried this in Xalan 2.7.0 unsuccessfully and also recreated the same
> problem this week in Xalan 2.7.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org