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:23:57 UTC

cvs commit: xml-xalan/test/tests/conf/match match29.xsl match27.xsl match28.xml match28.xsl match29.xml match27.xml

dmarston    01/11/14 12:23:57

  Added:       test/tests/conf/match match29.xsl match27.xsl match28.xml
                        match28.xsl match29.xml match27.xml
  Log:
  Attempts to optimize certain match patterns exposed a bug.
  These tests cover the patterns that are susceptible.
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/match/match29.xsl
  
  Index: match29.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  
    <!-- FileName: match29 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.2 -->
    <!-- Creator: David Marston, from an idea by Holger Floerke -->
    <!-- Purpose: // at start of match pattern should not affect selection of nodes. -->
  
  <xsl:output method="xml" encoding="UTF-8" />
  
  <xsl:template match="/">
    <out>
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="unprefixed" />
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="prefixed" />
    </out>
  </xsl:template>
  
  <xsl:template match="B//X" mode="unprefixed">
    <foundX><xsl:copy-of select="@level"/></foundX>
  </xsl:template>
  
  <xsl:template match="//B//X" mode="prefixed">
    <found-X><xsl:copy-of select="@level"/></found-X>
  </xsl:template>
  
  <xsl:template match="X" mode="unprefixed" priority="0">
    <!-- Suppress other X nodes -->
  </xsl:template>
  
  <xsl:template match="X" mode="prefixed" priority="0">
    <!-- Suppress other X nodes -->
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/match/match27.xsl
  
  Index: match27.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  
    <!-- FileName: match27 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.2 -->
    <!-- Creator: David Marston, from an idea by Holger Floerke -->
    <!-- Purpose: // at start of match pattern should not affect selection of nodes. -->
  
  <xsl:output method="xml" encoding="UTF-8" />
  
  <xsl:template match="/">
    <out>
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="unprefixed" />
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="prefixed" />
    </out>
  </xsl:template>
  
  <xsl:template match="X" mode="unprefixed">
    <foundX><xsl:copy-of select="@level"/></foundX>
  </xsl:template>
  
  <xsl:template match="//X" mode="prefixed">
    <found-X><xsl:copy-of select="@level"/></found-X>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/match/match28.xml
  
  Index: match28.xml
  ===================================================================
  <?xml version="1.0"?>
  <A level="1">
    <X level="2">
       <B level="3">
          <X level="4">
            <C level="5">
              <X level="6"/>
            </C>
          </X>
       </B>
    </X>
  </A>
  
  
  1.1                  xml-xalan/test/tests/conf/match/match28.xsl
  
  Index: match28.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  
    <!-- FileName: match28 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.2 -->
    <!-- Creator: David Marston, from an idea by Holger Floerke -->
    <!-- Purpose: // at start of match pattern should not affect selection of nodes. -->
  
  <xsl:output method="xml" encoding="UTF-8" />
  
  <xsl:template match="/">
    <out>
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="unprefixed" />
      <xsl:text>&#10;</xsl:text>
      <xsl:apply-templates select="//X" mode="prefixed" />
    </out>
  </xsl:template>
  
  <xsl:template match="B/X" mode="unprefixed">
    <foundX><xsl:copy-of select="@level"/></foundX>
  </xsl:template>
  
  <xsl:template match="//B/X" mode="prefixed">
    <found-X><xsl:copy-of select="@level"/></found-X>
  </xsl:template>
  
  <xsl:template match="X" mode="unprefixed" priority="0">
    <!-- Suppress other X nodes -->
  </xsl:template>
  
  <xsl:template match="X" mode="prefixed" priority="0">
    <!-- Suppress other X nodes -->
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/match/match29.xml
  
  Index: match29.xml
  ===================================================================
  <?xml version="1.0"?>
  <A level="1">
    <X level="2">
       <B level="3">
          <X level="4">
            <C level="5">
              <X level="6"/>
            </C>
          </X>
       </B>
    </X>
  </A>
  
  
  1.1                  xml-xalan/test/tests/conf/match/match27.xml
  
  Index: match27.xml
  ===================================================================
  <?xml version="1.0"?>
  <A level="1">
    <X level="2">
       <B level="3">
          <X level="4">
            <C level="5">
              <X level="6"/>
            </C>
          </X>
       </B>
    </X>
  </A>
  
  

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