dmarston    00/12/17 13:22:13

  Added:       test/tests/conf/attribset/err attribseterr07.xsl
                        attribseterr01.xsl attribseterr02.xml
                        attribseterr02.xsl attribseterr03.xml
                        attribseterr03.xsl attribseterr04.xml
                        attribseterr04.xsl attribseterr05.xml
                        attribseterr05.xsl attribseterr06.xml
                        attribseterr06.xsl attribseterr07.xml
                        attribseterr01.xml
  Log:
  Copy of tests in Lotus/IBM repository
  
  Revision  Changes    Path
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr07.xsl
  
  Index: attribseterr07.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr07 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Set attributes of element, using an attribute set that 
doesn't exist. -->
    <!-- NOTE that the spec is unclear about what behavior is required! In a 
private email,
         James Clark said that it should be an error. Erratum to come? -->
    <!-- ExpectedException: attribute-set named set2 does not exist -->
  
  <xsl:template match="/">
    <out>
      <xsl:element name="test" use-attribute-sets="set1 set2"/>
    </out>
  </xsl:template>
  
  <xsl:attribute-set name="set1">
    <xsl:attribute name="color">black</xsl:attribute>
  </xsl:attribute-set>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr01.xsl
  
  Index: attribseterr01.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr01 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.3 Creating Attributes -->
    <!-- Purpose: Verify creating nodes other than text nodes during 
instantiation
         of the content of the xsl:attribute element is an error. Offending 
nodes
         can be ignored. -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
ElemTemplateElement error: Can not add foo to xsl:attribute -->
    <!-- ExpectedException: ElemTemplateElement error: Can not add foo to 
xsl:attribute -->
  
  <xsl:template match="/">
     <Out>
        <xsl:attribute name="attr1">
                 <foo/>
           <xsl:processing-instruction name="PDPI">Process 
this</xsl:processing-instruction>
                 <xsl:comment>This should be ignored</xsl:comment>
                 <xsl:copy-of select="doc2"/>
                OK
        </xsl:attribute>
     </Out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr02.xml
  
  Index: attribseterr02.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo>a</foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr02.xsl
  
  Index: attribseterr02.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr02 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Set up circular references of attribute-sets using each other 
-->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
xsl:attribute-set 'set1' used itself, which will cause an infinite loop. -->
    <!-- ExpectedException: xsl:attribute-set 'set1' used itself, which will 
cause an infinite loop. -->
  
  <xsl:template match="/">
      <out>
        <test1 xsl:use-attribute-sets="set1"></test1>
      </out>
  </xsl:template>
  
  <xsl:attribute-set name="set2" use-attribute-sets="set3">
    <xsl:attribute name="text-decoration">underline</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name="set1" use-attribute-sets="set2">
    <xsl:attribute name="color">black</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name="set3" use-attribute-sets="set1">
    <xsl:attribute name="font-size">14pt</xsl:attribute>
  </xsl:attribute-set>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr03.xml
  
  Index: attribseterr03.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc> 
  </doc> 
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr03.xsl
  
  Index: attribseterr03.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr03 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.3 Creating Attributes -->
    <!-- Purpose: Verify adding an attribute to node that is not an element
           is an error.  The attributes can be ignored.-->
    <!-- ExpectedException: Can not add xsl:attribute to xsl:attribute -->
    <!-- ExpectedException: ElemTemplateElement error: Can not add 
xsl:attribute to xsl:attribute -->
  
  <xsl:template match="/">
    <out>
      <xsl:element name="Element1">
        <xsl:attribute name="Att1">
          <xsl:attribute name="Att2">Wrong</xsl:attribute>
            OK
          </xsl:attribute>
        </xsl:element>    
      <xsl:attribute name="Att1">Also-Wrong</xsl:attribute>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr04.xml
  
  Index: attribseterr04.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo>a</foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr04.xsl
  
  Index: attribseterr04.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr04 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Omit name attribute in xsl:attribute-set. -->
    <!-- ExpectedException: xsl:attribute-set must have a name attribute. -->
  
  <xsl:template match="/">
    <out>
      <xsl:element name="test" use-attribute-sets="set1"/>
    </out>
  </xsl:template>
  
  <xsl:attribute-set>
    <xsl:attribute name="color">black</xsl:attribute>
  </xsl:attribute-set>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr05.xml
  
  Index: attribseterr05.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo>a</foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr05.xsl
  
  Index: attribseterr05.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr05 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.4 -->
    <!-- Purpose: Put illegal instructions in xsl:attribute-set. -->
    <!-- ExpectedException: ElemTemplateElement error: Can not add 
xsl:apply-templates to xsl:attribute-set -->
    <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: 
ElemTemplateElement error: Can not add xsl:apply-templates to xsl:attribute-set 
-->
  
  <xsl:template match="/">
    <out>
      <xsl:element name="test" use-attribute-sets="set1"/>
    </out>
  </xsl:template>
  
  <xsl:attribute-set name="set1">
    <xsl:attribute name="color">black</xsl:attribute>
    <xsl:apply-templates/>
  </xsl:attribute-set>
  
  </xsl:stylesheet>
  
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr06.xml
  
  Index: attribseterr06.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <foo>a</foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr06.xsl
  
  Index: attribseterr06.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: attribseterr06 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.1.4 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test placement of attribute-set inside a template, which is 
illegal. -->
    <!-- ExpectedException: xsl:attribute-set is not allowed inside a template! 
-->
    <!-- ExpectedException: XSLT: (StylesheetHandler) xsl:attribute-set is not 
allowed inside a template! -->
  
  <xsl:template match="/">
    <out>
      <xsl:attribute-set name="set2">
        <xsl:attribute name="text-decoration">underline</xsl:attribute>
      </xsl:attribute-set>
      <test1 xsl:use-attribute-sets="set1">This should fail</test1>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr07.xml
  
  Index: attribseterr07.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>\
    <foo>a</foo>
  </doc>
  
  
  1.1                  
xml-xalan/test/tests/conf/attribset/err/attribseterr01.xml
  
  Index: attribseterr01.xml
  ===================================================================
  <?xml version="1.0"?>
  <docs>
  <doc1>
        <a level="1">A1</a>
        <b level="1">B2</b>
        <c level="1">C3</c>
  </doc1>
  <doc2>
        <a level="2">A1</a>
        <b level="2">B2</b>
        <c level="2">C3</c>
        <doc3>
                <a level="Out1">A1</a>
                <bat level="3">Out2</bat>
                <cat level="3">C33</cat>
        </doc3>
  </doc2>
  </docs> 
  
  

Reply via email to