dmarston    2002/08/06 07:42:19

  Added:       test/tests/conf/conflictres conflictres36.xsl
                        conflictres34.xsl conflictres35.xml
                        conflictres35.xsl conflictres36.xml
                        conflictres34.xml
  Log:
  Some test ideas from the to-do backlog that may be timely.
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres36.xsl
  
  Index: conflictres36.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conflictres36 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test that pattern containing * at one level is equal in 
priority
       to one containing * at a lower level. -->
    <!-- should see 1 conflict warning -->
  
  <xsl:template match="doc">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="a|b|d">
    <xsl:value-of select="name(.)"/><xsl:text>:</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>
  
  <xsl:template match="a/*/c">
    <xsl:value-of 
select="name(.)"/><xsl:text>-Wildcard-in-middle,&#10;</xsl:text>
  </xsl:template>
  
  <xsl:template match="a/b/*">
    <xsl:value-of select="name(.)"/><xsl:text>-Wildcard-last,&#10;</xsl:text>
  </xsl:template>
  
  <xsl:template match="text()"/><!-- Suppress whitespace -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres34.xsl
  
  Index: conflictres34.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conflictres34 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Confirm default priority of 0 for 
processing-instruction('name') pattern. -->
    <!-- should see no conflict warnings -->
  
  <xsl:template match="doc">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="processing-instruction()" priority="-0.1">
    <xsl:text>Any-PI:</xsl:text><xsl:value-of select="name(.)"/>
  </xsl:template>
  
  <xsl:template match="processing-instruction()[.='junk']" priority="0.1">
    <xsl:text>PI-by-content:</xsl:text><xsl:value-of select="name(.)"/>
  </xsl:template>
  
  <xsl:template match="processing-instruction('b-pi')">
    <xsl:text>PI-named-b:</xsl:text><xsl:value-of select="."/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres35.xml
  
  Index: conflictres35.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <a>
      <b><c/></b>
      <b><c><d><e/></d></c></b>
      <e><c/></e>
      <e><b><c/></b></e>
      <e><c><d/></c></e>
    </a>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres35.xsl
  
  Index: conflictres35.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conflictres35 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test that pattern a//b is equal priority than a/b, even though
       it allows more nodes to qualify. -->
    <!-- should see 2 conflict warnings -->
  
  <xsl:template match="doc">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="a|c|d|e">
    <xsl:value-of select="name(.)"/><xsl:text>:</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>
  
  <xsl:template match="a//b">
    <xsl:value-of select="name(.)"/><xsl:text>-Descendant,</xsl:text>
  </xsl:template>
  
  <xsl:template match="a/b">
    <xsl:value-of select="name(.)"/><xsl:text>-Child,</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres36.xml
  
  Index: conflictres36.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <a>
      <b><c/></b>
      <b><d/></b>
      <d><c/></d>
    </a>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/conflictres/conflictres34.xml
  
  Index: conflictres34.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <?a-pi some data?>
    <?b-pi some data?>
    <?b-pi junk?>
    <?c-pi junk?>
  </doc>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to