dmarston    00/12/17 10:52:54

  Added:       test/tests/conf/namedtemplate/err namedtemplateerr12.xsl
                        namedtemplateerr01.xsl namedtemplateerr02.xml
                        namedtemplateerr02.xsl namedtemplateerr03.xml
                        namedtemplateerr03.xsl namedtemplateerr04.xml
                        namedtemplateerr04.xsl namedtemplateerr05.xml
                        namedtemplateerr05.xsl namedtemplateerr06.xml
                        namedtemplateerr06.xsl namedtemplateerr07.xml
                        namedtemplateerr07.xsl namedtemplateerr08.xml
                        namedtemplateerr08.xsl namedtemplateerr09.xml
                        namedtemplateerr09.xsl namedtemplateerr10.xml
                        namedtemplateerr10.xsl namedtemplateerr11.xml
                        namedtemplateerr11.xsl namedtemplateerr12.xml
                        namedtemplateerr01.xml
  Log:
  Copy of tests in Lotus/IBM repository
  
  Revision  Changes    Path
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr12.xsl
  
  Index: namedtemplateerr12.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr12 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Purpose: Error to have a stylesheet contain more then one template
       with the same name and same import precedence. -->
    <!-- Author: Paul Dick -->
    <!-- ExpectedException: There is already a template named: a -->
  
  <xsl:import href="a.xsl"/>
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template name="a"/>
        <xsl:apply-imports/>
    </out>
  </xsl:template>
  
  <xsl:template name="a">
    a
  </xsl:template>
  
  <xsl:template name="a">
    b
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr01.xsl
  
  Index: namedtemplateerr01.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr01 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test what happens with badly-formed select pattern in 
with-param. -->
    <!-- ExpectedException: Extra illegal tokens -->
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template name="tmplt1">
        <xsl:with-param name="pvar1" select="doc/[EMAIL PROTECTED]'below']"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="tmplt1" match="doc/doc">
    <xsl:param name="pvar1">Default text in pvar1</xsl:param>
    <xsl:value-of select="$pvar1"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr02.xml
  
  Index: namedtemplateerr02.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr02.xsl
  
  Index: namedtemplateerr02.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr02 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.6 -->
    <!-- Purpose: Error test- parameter of outer template unknown inside inner 
template. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: VariableReference given for variable out of context 
or without definition! -->
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template name="tmplt1">
        <xsl:with-param name="pvar1" select="555"/>
      </xsl:call-template>
  <xsl:text>
  Back to main template.</xsl:text>
    </out>
  </xsl:template>
  
  <xsl:template name="tmplt1">
    <xsl:param name="pvar1">pvar1 default data</xsl:param>
    <!-- pvar1 won't be in scope in next template, so pass it in via new 
variable. -->
    <xsl:variable name="passto2">
      <xsl:value-of select="number($pvar1)"/>
    </xsl:variable>
  
    <xsl:value-of select="$passto2"/><xsl:text>, </xsl:text>
    <xsl:call-template name="tmplt2">
      <xsl:with-param name="t1num" select="$passto2"/>
    </xsl:call-template>
    <xsl:text>
  Back to template 1.</xsl:text>
  </xsl:template>
  
  <xsl:template name="tmplt2">
    <xsl:param name="t1num">t1num default data</xsl:param>
    <xsl:value-of select="444 + $t1num"/><xsl:text>, prior item should be 999, 
</xsl:text>
    <xsl:value-of select="222 + $pvar1"/><xsl:text>, prior item should be 
777</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr03.xml
  
  Index: namedtemplateerr03.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a place="above">top-level-a</a>
      <doc>
        <a place="below">sub-level-a</a>
      </doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr03.xsl
  
  Index: namedtemplateerr03.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr03 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 -->
    <!-- Purpose: Try to do call-template without a template of the specified 
name. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: Could not find template named -->
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template name="tmplt2">
        <xsl:with-param name="pvar1" select="doc/a"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="tmplt1" match="doc/doc">
    <xsl:param name="pvar1">Default text in pvar1</xsl:param>
    <xsl:value-of select="$pvar1"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr04.xml
  
  Index: namedtemplateerr04.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a place="above">top-level-a</a>
      <doc>
        <a place="below">sub-level-a</a>
      </doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr04.xsl
  
  Index: namedtemplateerr04.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr04 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test child of call-template other than with-param. -->
    <!-- ExpectedException: Can not add #text to xsl:call-template -->
    <!-- ExpectedException: ElemTemplateElement error: Can not add #text to 
xsl:call-template -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
ElemTemplateElement error: Can not add #text to xsl:call-template -->
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template name="tmplt1">
        <xsl:text>This should not come out</xsl:text>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="tmplt1">
    <xsl:param name="pvar1">Default text in pvar1</xsl:param>
    <xsl:value-of select="$pvar1"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr05.xml
  
  Index: namedtemplateerr05.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a>test</a>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr05.xsl
  
  Index: namedtemplateerr05.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr05 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test param lacking name attribute. -->
    <!-- ExpectedException: XSL Error: xsl:param must have a name attribute. -->
  
  <xsl:template match="doc">
    <out>
      <xsl:variable name="RTF">
        <xsl:value-of select="a"/>
      </xsl:variable>
      <xsl:call-template name="ntmp1">
        <xsl:with-param name="pvar1" select="$RTF"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="ntmp1">
    <xsl:param>default data</xsl:param>
    <xsl:value-of select="$pvar1"/><xsl:text>,</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr06.xml
  
  Index: namedtemplateerr06.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a place="above">top-level-a</a>
      <doc>
        <a place="below">sub-level-a</a>
      </doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr06.xsl
  
  Index: namedtemplateerr06.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr06 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try to do call-template without its name attribute. -->
    <!-- ExpectedException: ??? -->
  
  <xsl:template match="doc">
    <out>
      <xsl:call-template>
        <xsl:with-param name="pvar1" select="doc/a"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="tmplt1" match="doc/doc">
    <xsl:param name="pvar1">Default text in pvar1</xsl:param>
    <xsl:value-of select="$pvar1"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr07.xml
  
  Index: namedtemplateerr07.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a>test</a>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr07.xsl
  
  Index: namedtemplateerr07.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr07 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test with-param lacking name attribute. -->
    <!-- ExpectedException: XSL Error: xsl:with-param must have a 'name' 
attribute. -->
  
  <xsl:template match="doc">
    <out>
      <xsl:variable name="RTF">
        <xsl:value-of select="a"/>
      </xsl:variable>
      <xsl:call-template name="ntmp1">
        <xsl:with-param select="$RTF"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="ntmp1">
    <xsl:param name="pvar1">default data</xsl:param>
    <xsl:value-of select="$pvar1"/><xsl:text>,</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr08.xml
  
  Index: namedtemplateerr08.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a>test</a>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr08.xsl
  
  Index: namedtemplateerr08.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr08 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:call-template at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:call-template not allowed 
inside a stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:call-template not allowed inside a stylesheet! -->
  
  <xsl:call-template name="ntmp1">
    <xsl:with-param name="pvar1" select="value"/>
  </xsl:call-template>
  
  <xsl:template name="ntmp1">
    <xsl:param name="pvar1">pvar1 default data</xsl:param>
    <xsl:param name="pvar2">pvar2 default data</xsl:param>
    <xsl:value-of select="$pvar1"/><xsl:text>,</xsl:text>
    <xsl:value-of select="$pvar2"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr09.xml
  
  Index: namedtemplateerr09.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a>test</a>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr09.xsl
  
  Index: namedtemplateerr09.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr09 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:with-param at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:with-param not allowed 
inside a stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:with-param not allowed inside a stylesheet! -->
  
  <xsl:with-param select="'foo'"/>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr10.xml
  
  Index: namedtemplateerr10.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a>test</a>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr10.xsl
  
  Index: namedtemplateerr10.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr10 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:with-param in a template, which is illegal. -->
    <!-- ExpectedException: xsl:with-param must be child of xsl:apply-templates 
or xsl:call-template -->
  
  <xsl:template match="doc">
    <xsl:with-param name="par1" select="'foo'"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr11.xml
  
  Index: namedtemplateerr11.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr11.xsl
  
  Index: namedtemplateerr11.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: namedtemplateerr11 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 6 Named Templates -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try to use an AVT for the template name when invoking. -->
    <!-- ExpectedException: Could not find template named: {$tocall} -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: Could 
not find template named: {$tocall} -->
  
  <xsl:template match="doc">
    <out>
      <xsl:variable name="tocall" select="'a'"/>
      <xsl:call-template name="{$tocall}"/>
    </out>
  </xsl:template>
  
  <xsl:template name="tocall">
    <xsl:text>This should NOT display!</xsl:text>
  </xsl:template>
  
  <xsl:template name="a">
    <xsl:text>We are in template a!</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr12.xml
  
  Index: namedtemplateerr12.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/namedtemplate/err/namedtemplateerr01.xml
  
  Index: namedtemplateerr01.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <a place="above">top-level-a</a>
      <doc>
        <a place="below">sub-level-a</a>
      </doc>
  </doc>
  
  

Reply via email to