PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.

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

*** shadow/3466 Thu Sep  6 10:58:29 2001
--- shadow/3466.tmp.23124       Thu Sep  6 10:58:29 2001
***************
*** 0 ****
--- 1,148 ----
+ +============================================================================+
+ | xsltc fails conf test position80 on last() with unionpaths of ancestors    |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 3466                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.0                   |
+ |   Resolution:                            Platform: Sun                     |
+ |     Severity: Normal                   OS/Version: Solaris                 |
+ |     Priority: Other                     Component: org.apache.xalan.xsltc  |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                     |
+ |  Reported By: [EMAIL PROTECTED]                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Expected Output
+ ---------------
+ <?xml version="1.0" encoding="UTF-8"?>
+ <out>
+       Title= BBB<name last-of="2">section</name>
+       Title= CCC<name last-of="1">section</name>
+       Title= YYY<name last-of="1">section</name>
+       Title= ZZZ<name last-of="2">section</name></out>
+ 
+ 
+ Obtained Output
+ ---------------
+ <?xml version="1.0" encoding="utf-8" ?>
+ <out>
+       Title= 
+   
+     AAA
+     
+       BBB
+       About this article
+     
+   
+   
+     CCC
+     ...
+   
+   
+     YYY
+     ...
+     
+       ZZZ
+       This is the section titled &quot;ZZZ&quot;.
+     
+   
+ 
+       Title= 
+     AAA
+     
+       BBB
+       About this article
+     
+   
+       Title= 
+     CCC
+     ...
+   
+       Title= 
+     YYY
+     ...
+     
+       ZZZ
+       This is the section titled &quot;ZZZ&quot;.
+     
+   
+       Title= AAA<name last-of="1">articleinfo</name>
+       Title= 
+       BBB
+       About this article
+     <name last-of="1">articleinfo</name>
+       Title= BBB<name last-of="2">section</name>
+       Title= About this article<name last-of="2">section</name>
+       Title= CCC<name last-of="1">section</name>
+       Title= ...<name last-of="1">section</name>
+       Title= YYY<name last-of="1">section</name>
+       Title= ...<name last-of="1">section</name>
+       Title= 
+       ZZZ
+       This is the section titled &quot;ZZZ&quot;.
+     <name last-of="1">section</name>
+       Title= ZZZ<name last-of="2">section</name>
+       Title= This is the section titled &quot;ZZZ&quot;.<name
+ last-of="2">section</name></out>
+ 
+ position80.xsl
+ --------------
+ <?xml version="1.0"?>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+     version="1.0">
+ 
+   <!-- FileName: position80 -->
+   <!-- Document: http://www.w3.org/TR/xpath -->
+   <!-- DocVersion: 19991116 -->
+   <!-- Section: 2.2 -->
+   <!-- Purpose: Ensure last() is working with unionpaths of ancestors. -->
+   <!-- Creator: Scott Boag -->
+ 
+ <xsl:template match="/">
+   <out>
+     <xsl:for-each select="//section/title">
+       Title= <xsl:value-of select="."/>
+       <xsl:variable name="size">
+         <xsl:value-of select="count(ancestor::section
+           |ancestor::simplesect|ancestor::articleinfo)"/>
+       </xsl:variable>
+       <xsl:for-each select="(ancestor::section|ancestor::simplesect
+         |ancestor::articleinfo)[last()]">
+         <name>
+           <xsl:attribute name="last-of">
+             <xsl:value-of select="$size"/>
+           </xsl:attribute>
+           <xsl:value-of select="name(.)"/>
+         </name>
+       </xsl:for-each>
+     </xsl:for-each>
+   </out>
+ </xsl:template>
+ 
+ </xsl:stylesheet>
+ 
+ position80.xml
+ --------------
+ <article class="whitepaper" status="Note">
+   <articleinfo>
+     <title>AAA</title>
+     <section id="info">
+       <title>BBB</title>
+       <para>About this article</para>
+     </section>
+   </articleinfo>
+   <section id="intro">
+     <title>CCC</title>
+     <para>...</para>
+   </section>
+   <section>
+     <title>YYY</title>
+     <para>...</para>
+     <section revisionflag="added">
+       <title>ZZZ</title>
+       <para>This is the section titled "ZZZ".</para>
+     </section>
+   </section>
+ </article>

Reply via email to