Subjects
Home
Xalan extension functions
Fomatting question serializing DOM with pretty print
xalan with pull parser
Cannot find the declaration
Apache Xalan drop support to run on JRE 1 1 x
Why does Doctype change processing of a document
Node set to XML string via Java extensions in Xalan J: possible?
Templates/Transformers + thread safety???
Problem evaluating xpath with muliple prefix with different namespace
remove an arbitrary attribute from xsl output
Xalan3 XSLT 2 0 XPath 2 0 support?
Problem using compiled translets with Xalan !!
Xalan and jstl 1 1 problem with transform tag
NullPointer in DOM2DTM getLocalName
URIResolvers base parameter with xsltc and cascaded imports
Performance problem for Xalan J on intel dual core
Standard libraries in JAXP?
Serializing a DOM tree to XML file, customize entities replacement
Library Conflict Involving BCEL Library
A question on how users are using <xsl:message >
Kevin Cormier as a new Apache Xalan J committer
Struggling to iterate over tokenized string
Xalan count() trouble
Problem with recursive xpath
Error when switching to java 1 5
document( ' ')
Problem with Xalan2 7 0 transformation
cr/lf options
entity encoded XML
can xalan transform 2 xml using one xslt?
Xalan J JIRA defect review Monday October 16, 2006 from 2:00 to 3:30 pm ED
xsl transform with cdata section elements
xslt parameters not expanded
Weird behavior of XPath evaluate()
How to avoid <xsl:message > instruction prints stylesheet file informations ?
Cannot find SimpleTransform subdirectory after installing Xalan J
recover from document not found exceptions
jdk1 5 and Xalan jar differences?
Performance Issue
Error/Bug adding floating point numbers
XPathAPI: eval exp using nodes with default namespace
modifying xalan to output invalid XML
NullPointerException
mege two separate xml nodes into one
Is this a XALAN document identification bug?
is StylesheetRoot really java io Serializable ?
transform() fails for DOMSource but succeeds for StreamSource
Thoughts on Transformer parameter passing
HELP, Xalan and jstl 1 1 problem with transformer
Problem with XPath namespace axis?
string utils:replace deleting search string if replacement string is an HTML
help with enumeration values pls
xalan 2 5 1 vs 2 7 performance question
How to insert/update in XML document
HTML Serialization and Handling of Ampersands in HREF Attributes
XHTML link tag stripping
SystemId Unknown; Line #24; Column #49; java lang NullPointerException
xpath text() help
Apostrophe problem with xalan 2 7 0
How to set variables in XML document?
Links
Home
Oracle database error code ...
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Getting NullPointerException when upgrading from 2.5.1 to 2.7.0 during setPa

Getting NullPointerException when upgrading from 2.5.1 to 2.7.0 during setPa

2006-04-26       - By toadie D
Reply:     1     2     3     4     5  

>
>  We are upgrading from 2.5.1 to 2.7.0 and am seeing NPE being thrown when
> 2.5.1 used to throw a TransformerException.
>
> The use case is
>
> we are using entity parameter in the XSLT .  In 2.5.1, if a parameter is
> NOT defined but referenced, a TransformerException is thrown.  But in
> 2.7.0, we are getting a NPE instead .  Any idea if this is a confirmed
> change of behavior in 2.7.0 ?
>
> sample XSL snippet
>
> <!DOCTYPE xsl:stylesheet [
>       <!ENTITY MY_ROOT_VALUE      '5'>
> ]>
>
>          SAXTransformerFactory tf =
> (SAXTransformerFactory)SAXTransformerFactory.newInstance();
>
>         Templates  tmp = getTemplates();
>         if (tmp == null)
>         {
>             String msg  = "XSL transformer source is null.";
>             ParserConfigurationException pce = new
> ParserConfigurationException(msg);
>             if (m_log != null) m_log.error(msg, pce);
>             throw pce;
>         }
>
>         TransformerHandler th = tf.newTransformerHandler(tmp);
>         Transformer t = th.getTransformer();
>
>        //Add any optional parameters
>         if (m_parameters != null)
>         {
>             Iterator i = m_parameters.keySet().iterator();
>             while (i.hasNext())
>             {
>                 String name = (String)i.next();
>                 Object value = m_parameters.get(name);
>                 t.setParameter(name, value);   --->>> NPE Thrown here.
>             }
>         }
>    org.apache.xalan.transformer.TransformerImpl.setParameter(
> TransformerImpl.java:1558)
> at org.apache.xalan.transformer.TransformerImpl.setParameter(
> TransformerImpl.java:1606)
> at com.amx.translationstep.translate (translationstep.java :226)
> at ...
>
>

<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0
.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="DIRECTION: ltr">
<div>We are upgrading from 2.5.1 to 2.7.0 and am seeing NPE being thrown when 2
.5.1 used to throw a TransformerException.</div>
<div>&nbsp;</div>
<div>The use case is</div>
<div>&nbsp;</div>
<div>we are using&nbsp;entity parameter in the XSLT .&nbsp; In 2.5.1, if a
parameter is NOT defined but referenced, a TransformerException is thrown.&nbsp
; But in 2.7.0, we are getting a NPE instead .&nbsp; Any idea if this is a
confirmed</div>

<div>change of behavior in 2.7.0 ? </div>
<div>&nbsp;</div>
<div>sample XSL snippet</div>
<div>&nbsp;</div>
<div>&lt;!DOCTYPE xsl:stylesheet [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;
!ENTITY MY_ROOT_VALUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '5'&gt;<br>]&gt;<br>&nbsp;<
/div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SAXTransformerFactory tf
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();</div>
<div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Templates&nbsp; tmp =
getTemplates();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (tmp == null)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String msg&nbsp; = &quot;XSL
transformer source is null.&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp; ParserConfigurationException pce = new
ParserConfigurationException(msg);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (m
_log != null) m_log.error(msg, pce);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw pce;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TransformerHandler th = tf
.newTransformerHandler(tmp);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Transformer t = th.getTransformer();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Add any optional parameters<br>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (m_parameters != null)<br>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; Iterator i = m_parameters.keySet().iterator();<br>&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (i.hasNext()
)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; String name = (String)i.next();
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; Object value = m_parameters.get(name);<br>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t
.setParameter(name, value);&nbsp;&nbsp; ---&gt;&gt;&gt;&nbsp;NPE Thrown here.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p></div>
<div>&nbsp;&nbsp; org.apache.xalan.transformer.TransformerImpl.setParameter
(TransformerImpl.java:1558) <br>at org.apache.xalan.transformer.TransformerImpl
.setParameter(TransformerImpl.java:1606) <br>at com.amx.translationstep
.translate
(translationstep.java :226) <br>at ...<br>&nbsp;</div></div></blockquote></div
><br>