DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4781>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4781

xsltc selecting node not specified by key

           Summary: xsltc selecting node not specified by key
           Product: XalanJ2
           Version: 2.0.0
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


xsltc is failing conf test idkey34. It it outputting the value of the first 
<p> in the xml doc, "the whole document" even though it doesn't match 
the nodes selected by

<xsl:key name="mykey" match="div" use="title" />
<xsl:for-each select="key('mykey', 'Introduction')//p">


Running xalan on idkey34
<?xml version="1.0" encoding="UTF-8"?>
<out>Intro Section.
Body of Intro.
Intro to SS subsection.
Body of SS Intro.
Intro to Appendix.
Body of App1.
Body of App2.
Body of App3sub.
</out>


Running XSLTC with Xerces Parser on idkey34
<?xml version="1.0" encoding="UTF-8" ?>
<out>The whole document.
Intro Section.
Body of Intro.
Intro to SS subsection.
Body of SS Intro.
Intro to Appendix.
Body of App1.
Body of App2.
Body of App3sub.
</out>

idkey34.xsl
-----------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

  <!-- FileName: idkey34 -->
  <!-- Document: http://www.w3.org/TR/xslt -->
  <!-- DocVersion: 19991116 -->
  <!-- Section: 12.2 -->
  <!-- Creator: David Marston -->
  <!-- Purpose: Test descendants of node-set from key(). -->

<xsl:key name="mykey" match="div" use="title" />

<xsl:template match="doc">
  <out>
    <xsl:for-each select="key('mykey', 'Introduction')//p">
      <xsl:value-of select="."/><xsl:text>
</xsl:text>
    </xsl:for-each>
  </out>
</xsl:template>

</xsl:stylesheet>

idkey34.xml
-----------
<?xml version="1.0"?>
<doc>
  <p>The whole document.</p>
  <div>
    <title>Introduction</title>
    <p>Intro Section.</p>
    <body>Deeper
      <p>Body of Intro.</p>junk
    </body>
  </div>
  
  <div>
    <title>Stylesheet Structure</title>
    <p>SS Section.</p>
    <div>
      <title>Introduction</title>
      <p>Intro to SS subsection.</p>
      <body>Deeper
        <p>Body of SS Intro.</p>junk
      </body>
    </div>
    <body>Deeper
      <p>Body of SS.</p>junk
    </body>
  </div>
  
  <div>
    <title>Expressions</title>
    <p>Exp Section.</p>
    <body>Deeper
      <p>Body of Exp.</p>junk
    </body>
  </div>

  <appendix>
    <title>Appendix Title</title>
    <p>Appendix.</p>
    <div>
      <title>Introduction</title>
      <p>Intro to Appendix.</p>
      <body>Deeper
        <Sect1>Into 1
          <p>Body of App1.</p>junk
        </Sect1>
        <Sect2>Into 2
          <p>Body of App2.</p>junk
        </Sect2>
        <Sect3>Into 3
          <sub>Further Into 3
            <p>Body of App3sub.</p>junk
          </sub>Coming back
        </Sect3>Back
      </body>Back to div
    </div>Out of div
  </appendix>
</doc>

Reply via email to