dmarston    00/12/15 12:02:04

  Added:       test/tests/conf/conditional/err conditionalerr22.xsl
                        conditionalerr01.xsl conditionalerr02.xml
                        conditionalerr02.xsl conditionalerr03.xml
                        conditionalerr03.xsl conditionalerr04.xml
                        conditionalerr04.xsl conditionalerr05.xml
                        conditionalerr05.xsl conditionalerr06.xml
                        conditionalerr06.xsl conditionalerr07.xml
                        conditionalerr07.xsl conditionalerr08.xml
                        conditionalerr08.xsl conditionalerr09.xml
                        conditionalerr09.xsl conditionalerr10.xml
                        conditionalerr10.xsl conditionalerr11.xml
                        conditionalerr11.xsl conditionalerr12.xml
                        conditionalerr12.xsl conditionalerr13.xml
                        conditionalerr13.xsl conditionalerr14.xml
                        conditionalerr14.xsl conditionalerr15.xml
                        conditionalerr15.xsl conditionalerr16.xml
                        conditionalerr16.xsl conditionalerr17.xml
                        conditionalerr17.xsl conditionalerr18.xml
                        conditionalerr18.xsl conditionalerr19.xml
                        conditionalerr19.xsl conditionalerr20.xml
                        conditionalerr20.xsl conditionalerr21.xml
                        conditionalerr21.xsl conditionalerr22.xml
                        conditionalerr01.xml
  Log:
  Copy of tests in Lotus/IBM repository
  
  Revision  Changes    Path
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr22.xsl
  
  Index: conditionalerr22.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr22 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:otherwise at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:otherwise not allowed 
inside a stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:otherwise not allowed inside a stylesheet! -->
  
  <xsl:otherwise>Female: </xsl:otherwise>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr01.xsl
  
  Index: conditionalerr01.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr01 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Purpose: Test for xsl:choose with no when or otherwise clauses. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: xsl:choose requires an xsl:when -->
  
  <xsl:template match="/doc">
    <out>
      <xsl:for-each select="critter">
        <xsl:choose>
        </xsl:choose>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr02.xml
  
  Index: conditionalerr02.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr02.xsl
  
  Index: conditionalerr02.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr02 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:choose without xsl:when, but otherwise exists. -->
    <!-- ExpectedException: xsl:choose requires an xsl:when -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:otherwise>1</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr03.xml
  
  Index: conditionalerr03.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr03.xsl
  
  Index: conditionalerr03.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr03 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test of xsl:choose containing sub-element that is not a when 
or otherwise. -->
    <!-- ExpectedException: ElemTemplateElement error: Can not add #text to 
xsl:choose -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
ElemTemplateElement error: Can not add #text to xsl:choose -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:text>Inside choose</xsl:text>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr04.xml
  
  Index: conditionalerr04.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr04.xsl
  
  Index: conditionalerr04.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr04 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Purpose: Test xsl:choose having more than one xsl:otherwise. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: (StylesheetHandler) misplaced xsl:otherwise! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) misplaced xsl:otherwise! -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="false()">Should not get this output!</xsl:when>
        <xsl:otherwise>1</xsl:otherwise>
        <xsl:otherwise>2</xsl:otherwise>
        <xsl:otherwise>3</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr05.xml
  
  Index: conditionalerr05.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr05.xsl
  
  Index: conditionalerr05.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr05 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Purpose: Test xsl:when after xsl:otherwise, match on final when. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: (StylesheetHandler) misplaced xsl:when! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) misplaced xsl:when! -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="blah">BAD</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
        <xsl:when test="foo">1</xsl:when>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr06.xml
  
  Index: conditionalerr06.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr06.xsl
  
  Index: conditionalerr06.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr06 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test bad attribute on xsl:when (only "test" allowed). -->
    <!-- ExpectedException: xsl:when has an illegal attribute: name -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="foo" name="pointless">1</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr07.xml
  
  Index: conditionalerr07.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr07.xsl
  
  Index: conditionalerr07.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr07 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test attempt to put attribute on xsl:otherwise. -->
    <!-- ExpectedException: xsl:otherwise has an illegal attribute: test -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="blah">BAD</xsl:when>
        <xsl:otherwise test="not(blah)">0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr08.xml
  
  Index: conditionalerr08.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr08.xsl
  
  Index: conditionalerr08.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr08 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test attempt to put attribute on xsl:choose. -->
    <!-- ExpectedException: xsl:choose has an illegal attribute: name -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose name="outer">
        <xsl:when test="foo">1</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr09.xml
  
  Index: conditionalerr09.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr09.xsl
  
  Index: conditionalerr09.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr09 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.1 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:if that lacks the required "test" attribute. -->
    <!-- ExpectedException: xsl:if must have a test attribute -->
  
  <xsl:template match="/">
    <out>
      <xsl:if>
        <xsl:text>string</xsl:text>
      </xsl:if>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr10.xml
  
  Index: conditionalerr10.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <doc>
  this text shouldn't be here.
  </doc>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr10.xsl
  
  Index: conditionalerr10.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr10 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.1 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:if that has an empty "test" attribute. -->
    <!-- ExpectedException: xsl:if must have a test attribute -->
  
  <xsl:template match="/">
    <out>
      <xsl:if test="">
        <xsl:text>string</xsl:text>
      </xsl:if>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr11.xml
  
  Index: conditionalerr11.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <person><sex>M</sex><name>John</name></person>
    <person><sex>F</sex><name>Jane</name></person>
    <person><sex>H</sex><name>Hermaphrodite</name></person>
    <person><sex>12</sex><name>Prince</name></person>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr11.xsl
  
  Index: conditionalerr11.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr11 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try to use when outside of choose. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:when not parented by 
xsl:choose! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:when not parented by xsl:choose! -->
  
  <xsl:template match="/doc">
    <out>
      <xsl:for-each select="person">
        <xsl:when test="sex='M'">&#xa;Male: </xsl:when>
        <xsl:value-of select="name"/>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr12.xml
  
  Index: conditionalerr12.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <person><sex>M</sex><name>John</name></person>
    <person><sex>F</sex><name>Jane</name></person>
    <person><sex>H</sex><name>Hermaphrodite</name></person>
    <person><sex>12</sex><name>Prince</name></person>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr12.xsl
  
  Index: conditionalerr12.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr12 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try to use otherwise outside of choose. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:otherwise not parented by 
xsl:choose! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:otherwise not parented by xsl:choose! -->
  
  <xsl:template match="/doc">
    <out>
      <xsl:for-each select="person">
        <xsl:otherwise>&#xa;Male: </xsl:otherwise>
        <xsl:value-of select="name"/>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr13.xml
  
  Index: conditionalerr13.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr13.xsl
  
  Index: conditionalerr13.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr13 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:when lacking the "test" attribute. -->
    <!-- ExpectedException: xsl:when must have a 'test' attribute -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when>1</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr14.xml
  
  Index: conditionalerr14.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr14.xsl
  
  Index: conditionalerr14.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr14 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:when "test" having null content. -->
    <!-- ExpectedException: xsl:when must have a 'test' attribute -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="">1</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr15.xml
  
  Index: conditionalerr15.xml
  ===================================================================
  <?xml version="1.0"?>
  <Family>
  <Child name="Harry">
  <Name>Harry</Name>
  </Child>
  <Child name="Tom">
  <Name>Tom</Name>
  </Child>
  <Child name="Dick">
  <Name>Dick</Name>
  </Child>
  <Child name="John">
  <Name>Dick</Name>
  </Child>
  <Child name="Joe">
  <Name>Dick</Name>
  </Child>
  <Child name="Paulette">
  <Name>Paulette</Name>
  </Child>
  <Child name="Peter">
  <Name>Peter</Name>
  </Child>
  </Family>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr15.xsl
  
  Index: conditionalerr15.xsl
  ===================================================================
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr15 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.1 -->
    <!-- Purpose: Test of incorrect use of | where 'or' was intended. -->
    <!-- Creator: David Marston -->
    <!-- ExpectedException: ??? -->
    
  <xsl:template match="Family">
    <out>
      <xsl:for-each select="*">  
        <xsl:if test="@name='John' | @name='Joe'">
        <xsl:value-of select="@name"/> Smith</xsl:if><xsl:text>
  </xsl:text>  
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr16.xml
  
  Index: conditionalerr16.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo>
      <test/>
    </foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr16.xsl
  
  Index: conditionalerr16.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr16 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test use of non-existant variable in test attribute. -->
    <!-- ExpectedException: VariableReference given for variable out of context 
or without definition!  Name = level, source tree node: doc -->
  
  <xsl:template match="doc">
    <out>
      <xsl:if test='$level=1'>1</xsl:if>
    </out>
  </xsl:template>
   
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr17.xml
  
  Index: conditionalerr17.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <doc>
  this text shouldn't be here.
  </doc>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr17.xsl
  
  Index: conditionalerr17.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr17 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.1 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:if that has bad content in "test" attribute. -->
    <!-- ExpectedException: ? -->
  
  <xsl:template match="/">
    <out>
      <xsl:if test="�not(name(.)='')">
        <xsl:text>string</xsl:text>
      </xsl:if>
    </out>
  </xsl:template>
   
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr18.xml
  
  Index: conditionalerr18.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo/>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr18.xsl
  
  Index: conditionalerr18.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr18 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test xsl:when that has bad content in "test" attribute. -->
    <!-- ExpectedException: ? -->
  
  <xsl:template match="doc">
    <out>
      <xsl:choose>
        <xsl:when test="�not(name(.)='')">1</xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </out>
  </xsl:template>
   
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr19.xml
  
  Index: conditionalerr19.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <person><sex>M</sex><name>John</name></person>
    <person><sex>F</sex><name>Jane</name></person>
    <person><sex>H</sex><name>Hermaphrodite</name></person>
    <person><sex>12</sex><name>Prince</name></person>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr19.xsl
  
  Index: conditionalerr19.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr19 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:choose at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:choose not allowed inside a 
stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:choose not allowed inside a stylesheet! -->
  
  <xsl:choose>
    <xsl:when test="doc">Found a doc</xsl:when>
    <xsl:when test="person">Found a person</xsl:when>
    <xsl:otherwise>Who knows?</xsl:otherwise>
  </xsl:choose>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr20.xml
  
  Index: conditionalerr20.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr20.xsl
  
  Index: conditionalerr20.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr20 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.1 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:if at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:if not allowed inside a 
stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:if not allowed inside a stylesheet! -->
  
  <xsl:if test="true()">
    <xsl:text>This should fail</xsl:text>
  </xsl:if>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr21.xml
  
  Index: conditionalerr21.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <person><sex>M</sex><name>John</name></person>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr21.xsl
  
  Index: conditionalerr21.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: conditionalerr21 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 9.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Put xsl:when at top level, which is illegal. -->
    <!-- ExpectedException: (StylesheetHandler) xsl:when not allowed inside a 
stylesheet! -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
(StylesheetHandler) xsl:when not allowed inside a stylesheet! -->
  
  <xsl:when test="sex='M'">Male: </xsl:when>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr22.xml
  
  Index: conditionalerr22.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <person><sex>F</sex><name>Jane</name></person>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/conditional/err/conditionalerr01.xml
  
  Index: conditionalerr01.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <critter><name>Lassie</name></critter>
    <critter><name>Wishbone</name></critter>
    <critter><name>Felix</name></critter>
    <critter><name>Sylvester</name></critter>
  </doc>
  
  

Reply via email to