From the trace I assume that your source code actually had calls to
 
SaxonExtensions.GetUnitName()
Integer.toHexString()
DecimalFormat.new()
NumberFormat.format()
 
Something like the commented-out code in your second sample, in fact...
 
It's crashed because of a fairly simple bug in the diagnostic trace code for displaying the search process (it's trying to display a variable reference on the expression tree which is not yet full initialized, because parsing is not yet complete). The particular path where the problem is occurred is used for the format() method, which is overloaded and therefore requires rather more detailed analysis to determine which of the various format() methods to call. So I think this is rather a side-issue as far as your real problem is concerned; you can avoid the present crash by running without the -TJ option.
 
I do wonder what symx:formatNumber() is trying to do that couldn't be achieved more easily with the standard XSLT format-number() function.
 
Michael Kay
Saxonica

The xslt I am modifying has to following:

 

  <xsl:function name="symyx:format-number">

    <xsl:param name='num'/>

    <xsl:param name='pattern'/>

  <xsl:sequence select='$num'/>

  </xsl:function>

 

This appears to choke the transformer like so (with the –TJ option…output is a little long…more comments following that J):

 

 Trying method getCurrencyInstance: name does not match

Trying method getDecimalFormatSymbols: name does not match

Trying method applyPattern: name does not match

Trying field INTEGER_FIELD: name does not match

Trying field FRACTION_FIELD: name does not match

Finding best fit method with arguments:

java.lang.NullPointerException

      at java.lang.CharSequence.length(CharSequence.java)

      at net.sf.saxon.event.XMLEmitter.attribute(XMLEmitter.java:386)

      at net.sf.saxon.event.XMLIndenter.attribute(XMLIndenter.java:130)

      at net.sf.saxon.trace.ExpressionPresenter.emitAttribute(ExpressionPresenter.java:138)

      at net.sf.saxon.expr.VariableReference.explain(VariableReference.java:494)

      at net.sf.saxon.expr.FunctionCall.explain(FunctionCall.java:375)

      at net.sf.saxon.functions.JavaExtensionLibrary.getBestFit(JavaExtensionLibrary.java:498)

      at net.sf.saxon.functions.JavaExtensionLibrary.bind(JavaExtensionLibrary.java:450)

      at net.sf.saxon.functions.FunctionLibraryList.bind(FunctionLibraryList.java:83)

      at net.sf.saxon.expr.ExpressionParser.parseFunctionCall(ExpressionParser.java:1840)

....

 

 Merely replacing this code with

 

  <xsl:function name="symyx:format-number">

    <xsl:param name='num'/>

    <xsl:param name='pattern'/>

    <!--

<xsl:sequence select='if ($num) then df:format(df:new($pattern), xs:double($num)) else ""' xmlns:df='java:java.text.DecimalFormat'/>

-->

  <xsl:sequence select='$num'/>

 

  </xsl:function>

 

 

seems to remedy the problem (a hackto narrow down what was causing the issue).  Any ideas?  The lovely thing is that I know squat about java J

 

Thanks,

 

 

Steve

=======
Notice: This e-mail message, together with any attachments, contains
information of Symyx Technologies, Inc. or any of its affiliates or
subsidiaries that may be confidential, proprietary, copyrighted,
privileged and/or protected work product, and is meant solely for
the intended recipient. If you are not the intended recipient, and
have received this message in error, please contact the sender
immediately, permanently delete the original and any copies of this
email and any attachments thereto.