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/12/19 22:00:38 UTC

cvs commit: xml-xalan/test/tests/conf/select select79.xsl select78.xsl select79.xml select78.xml

dmarston    01/12/19 13:00:38

  Added:       test/tests/conf/select select79.xsl select78.xsl
                        select79.xml select78.xml
  Log:
  Focus on current() more precisely
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/select/select79.xsl
  
  Index: select79.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
    <!-- FileName: select79 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Simple test of current() in apply-templates. -->
  
  <xsl:template match="doc">
    <out>
      <xsl:apply-templates select="foo">
        <xsl:with-param name="node" select="current()"/><!-- the doc node -->
      </xsl:apply-templates>
    </out>
  </xsl:template>
  
  <xsl:template match="foo">
    <xsl:param name="node" select="'duh'"/>
    <xsl:text>&#10;</xsl:text>
    <content>
      <xsl:attribute name="from">
        <xsl:value-of select="@name"/>
      </xsl:attribute>
      <xsl:attribute name="size">
        <xsl:value-of select="count($node)"/>
      </xsl:attribute>
      <xsl:value-of select="normalize-space($node)"/><!-- stringification of doc node -->
    </content>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/select/select78.xsl
  
  Index: select78.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
    <!-- FileName: select78 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Simple test of current() in for-each. -->
  
  <xsl:output method="xml" encoding="UTF-8"/>
  
  <xsl:template match="doc">
    <out>
      <xsl:for-each select="foo">
        <xsl:text>&#10;</xsl:text>
        <match>
          <xsl:value-of select="current()/@name"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="./@name"/>
        </match>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/select/select79.xml
  
  Index: select79.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <foo name="x">alpha</foo>
    <foo name="y">omega</foo>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/select/select78.xml
  
  Index: select78.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <foo name="x"/>
    <foo name="y"/>
  </doc>
  
  

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