dmarston    00/12/17 10:48:02

  Added:       test/tests/conf/mdocs/err mdocserr04.xsl mdocserr01.xsl
                        mdocserr02.xml mdocserr02.xsl mdocserr03.xml
                        mdocserr03.xsl mdocserr04.xml mdocserr01.xml
  Log:
  Copy of tests in Lotus/IBM repository
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr04.xsl
  
  Index: mdocserr04.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
                  xmlns:ped="ped.com">
  
    <!-- FileName: MDOCSerr04 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.2  -->
    <!-- Purpose: Top-level elements must have some namespace. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: top-level element test has no namespace -->
  
  <xsl:template match="doc">
    <out><xsl:text>
  </xsl:text>
      <xsl:copy-of select='document("")//test'/><xsl:text>
  </xsl:text>
    </out>
  </xsl:template>
  
  <ped:test>Test1</ped:test>
  <test>Test2</test>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr01.xsl
  
  Index: mdocserr01.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: MDOCSerr01 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.1 Multiple Source Documents -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test document() function with non-existent file. -->
    <!-- ExpectedException: File not found -->
  
  <xsl:template match="defaultcontent">
    <out>
      <xsl:apply-templates select="document('notfound.xml')/body">
        <xsl:with-param name="arg1">ok</xsl:with-param>
      </xsl:apply-templates>
    </out>
  </xsl:template>
  
  <xsl:template match="body">
    <xsl:param name="arg1">not ok</xsl:param>
    <xsl:value-of select="$arg1"/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr02.xml
  
  Index: mdocserr02.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <defaultcontent>
      <section1/>
      <section2/>
    </defaultcontent>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr02.xsl
  
  Index: mdocserr02.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: MDOCSerr02 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.1 Multiple Source Documents -->
    <!-- Purpose: Test document() function with zero arguments. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: document() function requires 1 or 2 arguments -->
  
  <xsl:template match="defaultcontent">
    <out>
      <xsl:apply-templates select="document()/body"/>
    </out>
  </xsl:template>
  
  <xsl:template match="body">
    <xsl:text>This should fail</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr03.xml
  
  Index: mdocserr03.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <defaultcontent>
      <section1/>
      <section2/>
    </defaultcontent>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr03.xsl
  
  Index: mdocserr03.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: MDOCSerr03 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.1 Multiple Source Documents -->
    <!-- Purpose: Test document() function with too many arguments. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: document() function requires 1 or 2 arguments -->
  
  <xsl:template match="defaultcontent">
    <out>
      <xsl:apply-templates 
select="document('../mdocs03a.xml','bad1','bad2')/body"/>
    </out>
  </xsl:template>
  
  <xsl:template match="body">
    <xsl:text>This should fail</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr04.xml
  
  Index: mdocserr04.xml
  ===================================================================
  <?xml version="1.0" ?>
  <doc>
    <test>ERROR</test>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/mdocs/err/mdocserr01.xml
  
  Index: mdocserr01.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <defaultcontent>
      <section1/>
      <section2/>
    </defaultcontent>
  </doc>
  
  

Reply via email to