Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1136

Variable not resolved in user defined extension element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.0.0
    • None
    • Xalan-extensions
    • None
    • Operating System: All
      Platform: All
    • 11743

    Description

      This problem was reported by Simon Kitching.

      Using the attached xml and stylesheet, you will get the following errors:

      <?xml version="1.0" encoding="UTF-8"?>
      Error:failed to evaluate expression at line [48] : Variable not
      resolvable: counterRef
      Error:exception in text_
      exception message:failed to evaluate expression at line [48] : Variable
      not resolvable: counterRef
      javax.xml.transform.TransformerException: failed to evaluate expression
      at line [48] : Variable not resolvable: counterRef
      at nz.co.ecnetwork.xsltmap.Extensions.reportError
      (Extensions.java:80)
      at nz.co.ecnetwork.xsltmap.Extensions.doSelect
      (Extensions.java:128)
      at nz.co.ecnetwork.xsltmap.Extensions.text_
      (Extensions.java:293)
      at nz.co.ecnetwork.xsltmap.Extensions.text(Extensions.java:242)
      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
      org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement
      (ExtensionHandlerJavaClass.java:413)
      at
      org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:257)
      at
      org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
      (TransformerImpl.java:2324)
      at
      org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
      at
      org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
      (TransformerImpl.java:2324)
      at
      org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode
      (TransformerImpl.java:2147)
      at
      org.apache.xalan.transformer.TransformerImpl.transformNode
      (TransformerImpl.java:1203)
      at
      org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)
      at
      org.apache.xalan.transformer.TransformerImpl.transform
      (TransformerImpl.java:1119)
      at
      org.apache.xalan.transformer.TransformerImpl.transform
      (TransformerImpl.java:1097)
      at org.apache.xalan.xslt.Process.main(Process.java:893)
      file:///home/simon/workdir/dev/src/xsltmap/test.xsl; Line 48; Column 62;
      java.lang.reflect.InvocationTargetException
      <foo1>bar</foo1><foo2/><foo3>bar</foo3><foo4>nz.co.ecnetwork.xsltmap.Counter@66a
      22b</foo4><foo5>0</foo5><foo7/>

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--test.xml
          0.0 kB
          Morris Kwan
        2. ASF.LICENSE.NOT.GRANTED--test.xsl
          1 kB
          Morris Kwan
        3. ASF.LICENSE.NOT.GRANTED--Extensions.java
          17 kB
          Morris Kwan
        4. ASF.LICENSE.NOT.GRANTED--Counter.java
          2 kB
          Morris Kwan
        5. ASF.LICENSE.NOT.GRANTED--test.xml
          0.0 kB
          Morris Kwan
        6. ASF.LICENSE.NOT.GRANTED--bug11743.patch
          1 kB
          Morris Kwan

        Activity

          People

            mkwan@ca.ibm.com Morris Kwan
            mkwan@ca.ibm.com Morris Kwan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: