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

xsl:sort does not work with nodeset variables

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6
    • None
    • Xalan
    • None
    • Java Plug-in 1.5.0_04 creates DocumentBuilderFactory, TransformerFactory, Transformer objects etc. using newInstance() methods.

    Description

      The symptoms I'm seeing are the same as in issue #Xalanj-860 but I can't use the same workaround. A template creates some elements within a variable, and then tries to sort the resulting nodeset. The following example produces no output:

      <?xml version="1.0" encoding="UTF-8"?>
      <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <output method="text"/>

      <template match="/">
      <variable name="foo">
      <xsl:element name="bar">
      <xsl:attribute name="priority">1</xsl:attribute>
      <text>Priority = 1</text>
      </xsl:element>
      <xsl:element name="bar">
      <xsl:attribute name="priority">2</xsl:attribute>
      <text>Priority = 2</text>
      </xsl:element>
      </variable>
      <for-each select="xalan:nodeset($foo)/xsl:bar">
      <xsl:sort data-type="number" order="descending" select="@priority"/>
      <value-of select="text()"/>
      </for-each>
      </template>
      </stylesheet>

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            dcaveney@the-wire.com dcaveney

            Dates

              Created:
              Updated:

              Slack

                Issue deployment