You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dm...@apache.org on 2001/11/14 21:46:27 UTC

cvs commit: xml-xalan/test/tests/conf/predicate predicate57.xsl predicate57.xml

dmarston    01/11/14 12:46:27

  Added:       test/tests/conf/predicate predicate57.xsl predicate57.xml
  Log:
  Another case derived from a mailed-in question.
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/predicate/predicate57.xsl
  
  Index: predicate57.xsl
  ===================================================================
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
  
    <!-- FileName: predicate57 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.4 -->
    <!-- Creator: David Marston, based on an idea by Mukund Raghavachari -->
    <!-- Purpose: Test use of count() in a predicate to count children. -->
  
  <xsl:output method="xml" encoding="UTF-8"/>
  
  <xsl:template match="/">
    <out>
      <xsl:text>tr nodes: </xsl:text><xsl:value-of select="count(//tr)"/>
      <xsl:text>, tr nodes with 3 td children: </xsl:text>
      <xsl:value-of select="count(//tr[count(./td) = 3])"/><xsl:text>
  </xsl:text>
      <nodes>
        <xsl:for-each select="//tr[count(./td) = 3]">
          <xsl:for-each select="td">
            <xsl:value-of select="."/>
            <xsl:if test="following-sibling::td">
              <xsl:text>, </xsl:text>
            </xsl:if>
          </xsl:for-each><xsl:text>
    </xsl:text>
        </xsl:for-each>
      </nodes>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/predicate/predicate57.xml
  
  Index: predicate57.xml
  ===================================================================
  <?xml version="1.0"?> 
  <table>
  <tr><td>1.1</td><td>1.2</td></tr>
  <tr><td>2.1</td><td>2.2</td><td>2.3</td></tr>
  <tr><td>3.1</td><td>3.2<td>3.2.1</td></td></tr>
  <tr><td>4<td>4.1<td>4.1.1</td></td></td></tr>
  <tr><td>5.1</td><td>5.2</td><td>5.3</td><td>5.4</td></tr>
  <tr><ta/><td>6.1</td><td>6.2</td></tr>
  <tr><ta/><td>7.1</td><td>7.2</td><td>7.3</td></tr>
  <tr><ta/><td>8.1</td><td>8.2</td><td>8.3</td><td>8.4</td></tr>
  </table>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org