Excluding result prefix of a namespace not declared caused NPE
--------------------------------------------------------------

                 Key: XALANJ-2320
                 URL: http://issues.apache.org/jira/browse/XALANJ-2320
             Project: XalanJ2
          Issue Type: Bug
          Components: transformation
    Affects Versions: 2.7
            Reporter: Andrew Hay
            Priority: Minor


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.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to