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 2002/03/05 22:18:10 UTC

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

dmarston    02/03/05 13:18:10

  Added:       test/tests/conf/select select80.xsl select80.xml
  Log:
  Test multiple predicates and node-set variables
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/select/select80.xsl
  
  Index: select80.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
    <!-- FileName: select80 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 8 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try a positional predicate on descendants of a node-set variable -->
  
  <xsl:output method="xml" encoding="UTF-8"/>
  
  <!-- Collect a node-set, outside any template -->
  <xsl:variable name="all" select="//OL[@real='yes']"/>
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates select="doc/OL//tag"/>
    </out>
  </xsl:template>
  
  <xsl:template match="tag">
    <xsl:text>Found the tag...
  </xsl:text>
    <xsl:apply-templates select="$all/LI[@flag][last()]"/><xsl:text>
  </xsl:text>
  </xsl:template>
  
  <xsl:template match="LI[@flag]">
    <xsl:value-of select="."/><xsl:text>,</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/select/select80.xml
  
  Index: select80.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
  <OL real="yes">
    <LI flag="yes">item1</LI>
    <LI>item2</LI>
    <LI flag="yes">item3</LI>
    <OL real="no">
      <LI flag="yes">subitem1n</LI>
      <LI>subitem2n</LI>
      <OL real="yes">
        <LI flag="yes">subsubitem-not-last</LI>
        <LI flag="yes">subsubitem-early</LI>
        <tag/>
      </OL>
    </OL>
  </OL>
  <OL real="no">
    <LI flag="yes">item1n</LI>
    <LI>item2n</LI>
    <OL real="yes">
      <LI flag="yes">subitem1</LI>
      <LI>subitem2</LI>
      <OL real="yes">
        <LI gag="yes">subsubitem-late</LI>
        <tag/>
      </OL>
    </OL>
  </OL>
  </doc>
  
  
  

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