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

"InternalRuntimeError: Expected element missing at 6" after upgrade to XALAN 2.7.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.2
    • None
    • DTM, XSLTC
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • None

    Description

      Hi,
      after upgrading to XALAN 2.7.2, I got very strange errors in one of my XSL transformations, but just for some documents. It took a while to find the problem:
      I have an extension function that returns a NodeList with some elements and text nodes (some HTML). Unfortunately this NodeList contained an empty text node as very last element. This is perfectly fine for DOM, because there is nothing that forbids empty text nodes. This empty node caused the following error when invoking <xsl:copy-of select=java:Class:myExtensionFunction()"/>:

      InternalRuntimeError: Expected element missing at 6

      (6 is the last node in the Node-Set, the empty text node)

      I fixed the issue by calling normalize() before returning the NodeList as quick hack. Later I did a better fix to not create the empty nodes at all.

      In XALAN 2.7.1 this worked without any problem.

      Attachments

        Issue Links

          Activity

            People

              shathaway Steven J. Hathaway
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: