Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-701

Fix on bad XALAN-675 fix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • CurrentCVS
    • CurrentCVS
    • XalanC
    • None
    • Any

    Description

      Due to fixes for XALANC-675 as of 02/06/2008 from dbertony, another bad behaviour.
      If a key is declared in xslt, but refers to unknown location, xalan reports en error about unknown key when key is being used.
      This part of code causes an exception:
      ...
      <xsl:key name="test-key" match="/NOTEXISTS" use="true()"/>
      <xsl:value-of select="count(key('test-key', true()))"/>
      <xsl:value-of select="count(key('test-key', false()))"/>
      ...

      Proposed fix is following:

      KeyTable.hpp patch:
      154a155,156
      >
      > KeyDeclarationVectorType m_allKeys;

      KeyTable.cpp patch:
      68a69,70
      > m_allKeys=keyDeclarations;
      >
      255a258,268
      > else
      > {
      > size_type nDeclarations=m_allKeys.size();
      > for (KeyDeclarationVectorType::size_type i = 0; i < nDeclarations; ++i)
      > {
      > if (*m_allKeys[i].getQName()==qname)
      >

      { > return &s_dummyList; > }

      > }
      > }

      Attachments

        1. KeyTable.hpp.patch
          0.1 kB
          Michael Kupchuk
        2. KeyTable.cpp.patch
          0.4 kB
          Michael Kupchuk
        3. jira-701.patch
          1 kB
          Steven J. Hathaway

        Issue Links

          Activity

            People

              shathaway Steven J. Hathaway
              michael.kupchuk Michael Kupchuk
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: