Hi again,

 

Please bear with me, as I am an xslt novice lloking into some xslt I did not write (but I need to make work).  We are looking at moving from 8.7.3 to 9.0, and I have finally figured out how to replace items that used to be handled my our own java code with .NET extensions instead (which are preferable for a number or reasons).  That is to say, my .NET extesions can now be loaded, with the caveat that they be in .NET 1.1 (VS 2003).  I have come across one last issue:

 

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):

 

 

Loading clitype:Symyx.AutomationStudio.Helpers.SaxonExtensions?partialname=SaxonExtensions

No Java class clitype:Symyx.AutomationStudio.Helpers.SaxonExtensions?partialname=SaxonExtensions could be loaded

Assembly SaxonExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fb4b5791c48b7e8a successfully loaded

Assembly codebase (GAC): file:///c:/windows/assembly/gac/saxonextensions/1.0.0.0__fb4b5791c48b7e8a/saxonextensions.dll

Looking for method GetUnitName in .NET type Symyx.AutomationStudio.Helpers.SaxonExtensions

Number of actual arguments = 1

Trying method GetHashCode: name does not match

Trying method Equals: name does not match

Trying method ToString: name does not match

Trying method GetStoredFileName: name does not match

Trying method GetUnitName: name matches

Method is static

Method has 1 argument; expecting 1

Found a candidate method:

    System.String GetUnitName(Int32)

Trying method GetType: name does not match

Loading java.lang.Integer

Looking for method toHexString in Java class class java.lang.Integer

Number of actual arguments = 1

Trying method getClass: name does not match

Trying method wait: name does not match

Trying method getInteger: name does not match

Trying method valueOf: name does not match

Trying method compareTo: name does not match

Trying method signum: name does not match

Trying method valueOf: name does not match

Trying method toOctalString: name does not match

Trying method valueOf: name does not match

Trying method wait: name does not match

Trying method floatValue: name does not match

Trying method toHexString: name matches

Method is static

Method has 1 argument; expecting 1

Found a candidate method:

    public static java.lang.String java.lang.Integer.toHexString(int)

Trying method parseInt: name does not match

Trying method compareTo: name does not match

Trying method wait: name does not match

Trying method hashCode: name does not match

Trying method parseInt: name does not match

Trying method bitCount: name does not match

Trying method equals: name does not match

Trying method numberOfTrailingZeros: name does not match

Trying method rotateLeft: name does not match

Trying method reverseBytes: name does not match

Trying method highestOneBit: name does not match

Trying method notify: name does not match

Trying method lowestOneBit: name does not match

Trying method rotateRight: name does not match

Trying method toString: name does not match

Trying method toString: name does not match

Trying method shortValue: name does not match

Trying method reverse: name does not match

Trying method numberOfLeadingZeros: name does not match

Trying method toString: name does not match

Trying method intValue: name does not match

Trying method longValue: name does not match

Trying method getInteger: name does not match

Trying method notifyAll: name does not match

Trying method toBinaryString: name does not match

Trying method getInteger: name does not match

Trying method doubleValue: name does not match

Trying method byteValue: name does not match

Trying method decode: name does not match

Trying field MAX_VALUE: name does not match

Trying field SIZE: name does not match

Trying field MIN_VALUE: name does not match

Trying field TYPE: name does not match

Loading java.text.DecimalFormat

Looking for method new in Java class class java.text.DecimalFormat

Number of actual arguments = 1

Looking for a constructor

Found a constructor with 2 arguments

Found a constructor with 0 arguments

Found a constructor with 1 arguments

Loading java.text.DecimalFormat

Looking for method format in Java class class java.text.DecimalFormat

Number of actual arguments = 2

Trying method setGroupingSize: name does not match

Trying method getClass: name does not match

Trying method setDecimalFormatSymbols: name does not match

Trying method wait: name does not match

Trying method toPattern: name does not match

Trying method setPositivePrefix: name does not match

Trying method format: name matches

Method is not static

Method has 3 arguments; expecting 2 plus one for the target object

Trying method isDecimalSeparatorAlwaysShown: name does not match

Trying method getInstance: name does not match

Trying method wait: name does not match

Trying method format: name matches

Method is not static

Method has 1 argument; expecting 2 plus one for the target object

Found a candidate method:

    public final java.lang.String java.text.NumberFormat.format(long)

Trying method getAvailableLocales: name does not match

Trying method getCurrencyInstance: name does not match

Trying method getPercentInstance: name does not match

Trying method applyLocalizedPattern: name does not match

Trying method getPositiveSuffix: name does not match

Trying method setPositiveSuffix: name does not match

Trying method format: name matches

Method is not static

Method has 1 argument; expecting 2 plus one for the target object

Found a candidate method:

    public final java.lang.String java.text.NumberFormat.format(double)

Trying method parse: name does not match

Trying method wait: name does not match

Trying method getMultiplier: name does not match

Trying method getNegativePrefix: name does not match

Trying method hashCode: name does not match

Trying method toLocalizedPattern: name does not match

Trying method format: name matches

Method is not static

Method has 1 argument; expecting 2 plus one for the target object

Found a candidate method:

    public final java.lang.String java.text.Format.format(java.lang.Object) throws java.lang.IllegalArgumentException

Trying method getNumberInstance: name does not match

Trying method getInstance: name does not match

Trying method setMinimumIntegerDigits: name does not match

Trying method setMaximumFractionDigits: name does not match

Trying method getPositivePrefix: name does not match

Trying method equals: name does not match

Trying method setParseBigDecimal: name does not match

Trying method setMaximumIntegerDigits: name does not match

Trying method getPercentInstance: name does not match

Trying method format: name matches

Method is not static

Method has 3 arguments; expecting 2 plus one for the target object

Trying method format: name matches

Method is not static

Method has 3 arguments; expecting 2 plus one for the target object

Trying method getCurrency: name does not match

Trying method getNegativeSuffix: name does not match

Trying method setGroupingUsed: name does not match

Trying method getNumberInstance: name does not match

Trying method clone: name does not match

Trying method parse: name does not match

Trying method getMaximumIntegerDigits: name does not match

Trying method getMinimumIntegerDigits: name does not match

Trying method getMaximumFractionDigits: name does not match

Trying method isParseBigDecimal: name does not match

Trying method getIntegerInstance: name does not match

Trying method isGroupingUsed: name does not match

Trying method notify: name does not match

Trying method getGroupingSize: name does not match

Trying method isParseIntegerOnly: name does not match

Trying method setNegativePrefix: name does not match

Trying method parseObject: name does not match

Trying method toString: name does not match

Trying method setMultiplier: name does not match

Trying method setParseIntegerOnly: name does not match

Trying method parseObject: name does not match

Trying method setNegativeSuffix: name does not match

Trying method formatToCharacterIterator: name does not match

Trying method getMinimumFractionDigits: name does not match

Trying method notifyAll: name does not match

Trying method setCurrency: name does not match

Trying method setDecimalSeparatorAlwaysShown: name does not match

Trying method setMinimumFractionDigits: name does not match

Trying method getIntegerInstance: name does not match

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)

      at net.sf.saxon.expr.ExpressionParser.parseBasicStep(ExpressionParser.java:1324)

      at net.sf.saxon.expr.ExpressionParser.parseStepExpression(ExpressionParser.java:1223)

      at net.sf.saxon.expr.ExpressionParser.parseRelativePath(ExpressionParser.java:1163)

      at net.sf.saxon.expr.ExpressionParser.parsePathExpression(ExpressionParser.java:1149)

      at net.sf.saxon.expr.ExpressionParser.parseUnaryExpression(ExpressionParser.java:1038)

      at net.sf.saxon.expr.ExpressionParser.parseCastExpression(ExpressionParser.java:701)

      at net.sf.saxon.expr.ExpressionParser.parseCastableExpression(ExpressionParser.java:656)

      at net.sf.saxon.expr.ExpressionParser.parseTreatExpression(ExpressionParser.java:637)

      at net.sf.saxon.expr.ExpressionParser.parseInstanceOfExpression(ExpressionParser.java:619)

      at net.sf.saxon.expr.ExpressionParser.parseIntersectExpression(ExpressionParser.java:1071)

      at net.sf.saxon.expr.ExpressionParser.parseUnionExpression(ExpressionParser.java:1053)

      at net.sf.saxon.expr.ExpressionParser.parseMultiplicativeExpression(ExpressionParser.java:990)

      at net.sf.saxon.expr.ExpressionParser.parseAdditiveExpression(ExpressionParser.java:970)

      at net.sf.saxon.expr.ExpressionParser.parseRangeExpression(ExpressionParser.java:886)

      at net.sf.saxon.expr.ExpressionParser.parseComparisonExpression(ExpressionParser.java:836)

      at net.sf.saxon.expr.ExpressionParser.parseAndExpression(ExpressionParser.java:433)

      at net.sf.saxon.expr.ExpressionParser.parseOrExpression(ExpressionParser.java:415)

      at net.sf.saxon.expr.ExpressionParser.parseExprSingle(ExpressionParser.java:364)

      at net.sf.saxon.expr.ExpressionParser.parseExpression(ExpressionParser.java:316)

      at net.sf.saxon.expr.ExpressionParser.parseIfExpression(ExpressionParser.java:600)

      at net.sf.saxon.expr.ExpressionParser.parseExprSingle(ExpressionParser.java:353)

      at net.sf.saxon.expr.ExpressionParser.parseExpression(ExpressionParser.java:316)

      at net.sf.saxon.expr.ExpressionParser.parse(ExpressionParser.java:238)

      at net.sf.saxon.expr.ExpressionTool.make(ExpressionTool.java:72)

      at net.sf.saxon.style.StyleElement.makeExpression(StyleElement.java:478)

      at net.sf.saxon.style.XSLSequence.prepareAttributes(XSLSequence.java:77)

      at net.sf.saxon.style.StyleElement.processAttributes(StyleElement.java:377)

      at net.sf.saxon.style.StyleElement.processAllAttributes(StyleElement.java:340)

      at net.sf.saxon.style.StyleElement.processAllAttributes(StyleElement.java:348)

      at net.sf.saxon.style.XSLStylesheet.processAllAttributes(XSLStylesheet.java:967)

      at net.sf.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:690)

      at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:336)

      at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163)

      at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)

      at net.sf.saxon.Transform.doTransform(Transform.java:663)

      at cli.Saxon.Cmd.DotNetTransform.Main(Unknown Source)

Fatal error during transformation: java.lang.NullPointerException:  (no message)

 

 

 

 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.