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/12/18 15:30:46 UTC
[jira] Commented: (XALANJ-2320) Excluding result prefix of a
namespace not declared caused NPE
[ https://issues.apache.org/jira/browse/XALANJ-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552767 ]
Andrew Hay commented on XALANJ-2320:
------------------------------------
Brian,
I've retested the issue and found that Xalan 2.7.1 fails in exactly the same way as before but with new line numbers in the Xalan classes :-
at org.apache.xalan.transformer.TransformerImpl.setParameter(TransformerImpl.java:1547)
at org.apache.xalan.transformer.TransformerImpl.setParameter(TransformerImpl.java:1595)
The example that I'd posted previously was just the xsl:stylesheet declaration and not the full stylesheet. To recreate, you can use any current stylesheet and add an exclude-result-prefixes attribute for a result prefix which you have not declared.
I was expecting Xalan to ignore the undeclared result prefix. However on reading the W3C XSL Transformations standards I can see that "It is an error if there is no namespace bound to the prefix on the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute.".
I am happy to close the issue as being a feature of Xalan 2.3.1 which has long since been removed by closer adherance to the standards.
Andy
> Excluding result prefix of a namespace not declared caused NPE
> --------------------------------------------------------------
>
> Key: XALANJ-2320
> URL: https://issues.apache.org/jira/browse/XALANJ-2320
> Project: XalanJ2
> Issue Type: Bug
> Components: transformation
> Affects Versions: 2.7
> Reporter: Andrew Hay
> Priority: Minor
> Fix For: 2.7.1
>
>
> Currently migrating from Xalan 2.3.1 to 2.7.0. Had an issue with an XSL stylesheet which declared a number or namespaces and excluded a number of result prefixes. This worked under 2.3.1 but produced NPE in 2.7.0 with stack trace of :-
> java.lang.NullPointerException
> at org.apache.xalan.transformer.TransformerImpl.setParameter(TransformerImpl.java:1558)
> at org.apache.xalan.transformer.TransformerImpl.setParameter(TransformerImpl.java:1606)
> at com.axa.framework.util.XSLEngineImpl.translate(XSLEngineImpl.java:140)
> at com.axa.framework.util.XSLEngineUtil.translate(XSLEngineUtil.java:79)
> at com.axa.framework.processor.EventProcessor.translate(EventProcessor.java:1198)
> at com.axa.framework.processor.EventProcessor.handleServiceEvent(EventProcessor.java:550)
> at com.axa.framework.processor.EventProcessor.process(EventProcessor.java:141)
> at com.axa.framework.processor.soap.RpcSOAPProcessorManager.handleEvent(RpcSOAPProcessorManager.java:83)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at com.axa.rpc.RpcThread.execute(RpcThread.java:240)
> at com.axa.rpc.RpcThread.run(RpcThread.java:135)
> The XSL stylesheet decalaration is :-
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:polphdr="http://www.polaris-uk.co.uk/GenericSchema/2_1/PEMHeader"
> xmlns:java="http://xml.apache.org/xslt/java"
> exclude-result-prefixes="axa soap-env java">
> The problem was resolved by removing axa from the list of namespaces. Would have expected a more graceful throwing of the error or ignoring of the result prefix exclusion if the namespace cannot be determined.
--
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