dmarston    01/08/03 08:01:44

  Modified:    test/tests/conf/copy copy03.xml copy01.xsl copy01.xml
  Added:       test/tests/conf/copy copy24.xml copy24.xsl copy25.xml
                        copy25.xsl copy26.xml copy26.xsl copy27.xml
                        copy27.xsl copy28.xml copy28.xsl copy30.xml
                        copy30.xsl copy31.xml copy31.xsl copy32.xml
                        copy32.xsl copy33.xml copy33.xsl copy34.xml
                        copy34.xsl copy35.xml copy35.xsl copy36.xml
                        copy36.xsl copy37.xml copy37.xsl copy38.xml
                        copy38.xsl copy39.xml copy39.xsl copy40.xml
                        copy40.xsl copy41.xml copy41.xsl copy42.xml
                        copy42.xsl copy43.xml copy43.xsl copy44.xml
                        copy44.xsl copy45.xml copy45.xsl copy46.xml
                        copy46.xsl
  Log:
  Expand coverage of copy-of and copy, based on review of existing test cases.
  New case copy29 is in suspense, awaiting bug determination.
  
  Revision  Changes    Path
  1.2       +5 -3      xml-xalan/test/tests/conf/copy/copy03.xml
  
  Index: copy03.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/copy/copy03.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- copy03.xml        2000/12/15 19:50:36     1.1
  +++ copy03.xml        2001/08/03 15:01:42     1.2
  @@ -1,13 +1,15 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0" encoding="UTF-8"?>
   <OL>
     <LI>item1</LI>
  -  <LI>item2</LI>
  +  <LI attrib="2">item2</LI>
     <LI>item3</LI>
     <OL>
       <LI>subitem1</LI>
  -    <LI>subitem2</LI>
  +    <LI attrib="2">subitem2</LI>
  +    <!-- Now go deeper -->
       <OL>
         <LI>subitem3</LI>
       </OL>
     </OL>
  +  <?a-pi some data?>
   </OL>
  
  
  
  1.2       +5 -5      xml-xalan/test/tests/conf/copy/copy01.xsl
  
  Index: copy01.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/copy/copy01.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- copy01.xsl        2000/12/15 19:50:36     1.1
  +++ copy01.xsl        2001/08/03 15:01:42     1.2
  @@ -1,12 +1,12 @@
   <?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  -  <!-- FileName: COPY01 -->
  +  <!-- FileName: copy01 -->
     <!-- Document: http://www.w3.org/TR/xslt -->
     <!-- DocVersion: 19991116 -->
     <!-- Section: 7.5 -->
     <!-- Creator: Paul Dick -->
  -  <!-- Purpose: Test for simple identity transformation with template match 
-->                
  +  <!-- Purpose: Test for simple identity transformation with template match 
-->
   
   <xsl:template match="/">
     <out>
  @@ -14,10 +14,10 @@
     </out>
   </xsl:template>
   
  -<xsl:template match="*|@*|comment()|processing-instruction()|text()">
  +<xsl:template match="@*|comment()|processing-instruction()|text()|*">
     <xsl:copy>
  -    <xsl:apply-templates 
select="*|@*|comment()|processing-instruction()|text()"/>
  +    <xsl:apply-templates 
select="@*|comment()|processing-instruction()|text()|*"/>
     </xsl:copy>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +5 -3      xml-xalan/test/tests/conf/copy/copy01.xml
  
  Index: copy01.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/copy/copy01.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- copy01.xml        2000/12/15 19:50:36     1.1
  +++ copy01.xml        2001/08/03 15:01:42     1.2
  @@ -1,13 +1,15 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0" encoding="UTF-8"?>
   <OL>
     <LI>item1</LI>
  -  <LI>item2</LI>
  +  <LI attrib="2">item2</LI>
     <LI>item3</LI>
     <OL>
       <LI>subitem1</LI>
  -    <LI>subitem2</LI>
  +    <LI attrib="2">subitem2</LI>
  +    <!-- Now go deeper -->
       <OL>
         <LI>subitem3</LI>
       </OL>
     </OL>
  +  <?a-pi some data?>
   </OL>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy24.xml
  
  Index: copy24.xml
  ===================================================================
  <?xml version="1.0"?> 
  <?a-pi some data?>
  <?pi-2 another?>
  <doc><!-- This is a comment -->
    test
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy24.xsl
  
  Index: copy24.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy24 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.3 -->
    <!-- Creator: Myriam Midy -->
    <!-- Purpose: Test for processing-instruction() node-test in copy-of. -->
  
  <!-- should say "Found-pi,,Found-pi" -->
  
  <xsl:template match="/">
    <out>
      <xsl:copy-of select="./processing-instruction('a-pi')"/><xsl:text>...
  </xsl:text>
      <xsl:copy-of select="./processing-instruction()"/><xsl:text>...
  </xsl:text>
      <xsl:copy-of select="*"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy25.xml
  
  Index: copy25.xml
  ===================================================================
  <?xml version="1.0"?>
  <main>
    <a attr="w">
      <b>
        <c dim="h">
          <d size="l"/>
        </c>
      </b>
    </a>
    <size for="d" h="17" />
    <size for="e" h="27" />
    <size for="d" w="37" />
    <size for="e" w="47" />
  </main>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy25.xsl
  
  Index: copy25.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy25 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Accumulate attributes from several places in the source. -->
  
  <xsl:output method="xml" encoding="UTF-8" />
  
  <xsl:template match="/">
    <out>
      <a>
        <!-- first, get all attribute nodes under the 'a' node in the source -->
        <xsl:for-each select="main/a/descendant-or-self::*/@*">
          <xsl:copy/>
        </xsl:for-each>
        <!-- next, get an attribute node from elsewhere -->
        <xsl:for-each select="main/[EMAIL PROTECTED]'d']">
          <xsl:apply-templates select="@h | @w"/>
        </xsl:for-each>
      </a>
    </out>
  </xsl:template>
  
  <xsl:template match="@*">
    <xsl:copy/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy26.xml
  
  Index: copy26.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <inc>
    <list>
      <node1>foo1</node1>
      <node2>foo2</node2>
      <node3>foo3</node3>
    </list>
    <node1>bar1</node1>
    <node2>bar2</node2>
    <node4 ax="by+c">bar4</node4>
  </inc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy26.xsl
  
  Index: copy26.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
  
    <!-- FileName: copy26 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: Bob Morris -->
    <!-- Purpose: Should be able to copy the same tree fragment twice in 
succession. -->
  
  <xsl:template match="/">
    <xsl:variable name ="theNode" select="//inc/node4"/>
    <out>
      <xsl:copy-of select="$theNode"/>
      <xsl:copy-of select="$theNode"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy27.xml
  
  Index: copy27.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <doc></doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy27.xsl
  
  Index: copy27.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
  
    <!-- FileName: copy27 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: Oliver Becker -->
    <!-- Purpose: Demonstrate copying a named template from the stylesheet
      into the result. From a thread on XSL-list 7/30/2001. -->
  
  <xsl:template name="qq">
    <node attr="8"/>
  </xsl:template>
   
  <xsl:template match="/">
    <results>
      <usual-result>
        <xsl:call-template name="qq"/>
      </usual-result>
      <xsl:text>&#10;</xsl:text>
      <exotic-result>
        <xsl:copy-of select="document('')/*/xsl:[EMAIL PROTECTED]'qq']/node()" 
/>
      </exotic-result>
    </results>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy28.xml
  
  Index: copy28.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <simple>abcde</simple>
    <empty/>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy28.xsl
  
  Index: copy28.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy28 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Purpose: Test for copy-of an empty node. -->
    <!-- Creator: David Marston -->
  
  <xsl:output method="xml" encoding="UTF-8"/>
  
  <xsl:template match="/">
    <out>
      <xsl:copy-of select="doc"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy30.xml
  
  Index: copy30.xml
  ===================================================================
  <?xml version="1.0"?>
  <docs>
    <doc1>
      <a level="1" origin="house">1a1</a>
      <a level="1" origin="Albany">1a2</a>
      <doc1supplement>
        <a level="1" origin="Austin">1xa1</a>
      </doc1supplement>
    </doc1>
    <doc2>
      <a level="2" origin="Baltimore">2a1</a>
      <b level="2" origin="Albany">2b1</b>
      <a level="2" origin="Portland">2a2</a>
      <a level="2" origin="Albany">2a3</a>
      <doc2supplement>
        <a level="3" origin="Chicago">2xa1</a>
        <a level="3" origin="Albany">2xa2</a>
        <a level="3" origin="Albany">2xa3</a>
        <d level="3" origin="Albany">2xd1</d>
      </doc2supplement>
    </doc2>
  </docs>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy30.xsl
  
  Index: copy30.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy30 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Use key() to try to create a set of nodes in random order. -->
  
  <xsl:key name="k" use="@origin" match="a" />
  
  <xsl:template match="/">
    <out>
      <xsl:copy-of select="key('k','Albany')"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy31.xml
  
  Index: copy31.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <root xmlns:ped="http://ped.test.com";>
    <Out xmlns:ns0="http://www.ns0.com"; ns0:Attr0="Hello" Attr1="Whatsup" 
ped:Attr2="Goodbye"/>
    <Out2 xmlns:bdd="http://bdd.test.com"/><!-- Unused namespace decl -->
  </root>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy31.xsl
  
  Index: copy31.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy31 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test for xsl:copy-of with nodeset. Shows handling of 
namespaces. -->
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match='node()|@*'>
    <xsl:copy>
      <xsl:apply-templates select='node()|@*'/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy32.xml
  
  Index: copy32.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- Comment-1 -->
  <far-north> Level-1
    <!-- Comment-2 --> Level-2
    <?a-pi pi-2?>
    <north>
         <!-- Comment-3 --> Level-3
         <?a-pi pi-3?>
       <near-north>
            <!-- Comment-4 --> Level-4
            <?a-pi pi-4?>
          <center>
             <near-south-west/>
                   <!-- Comment-5 -->   Level-5
                   <?a-pi pi-5?>
             <near-south>
                      <!-- Comment-6 -->   Level-6
                      <?a-pi pi-6?>
              <south attr1="First" attr2="Last">
                </south>
             </near-south>
          </center>
       </near-north>
    </north>
  </far-north>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy32.xsl
  
  Index: copy32.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy32 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Make each comment be the current node, and copy it. -->
  
  <xsl:template match="/">
    <out>
      <xsl:for-each select="//comment()">
        <xsl:copy/><xsl:text>
  </xsl:text>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy33.xml
  
  Index: copy33.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- Comment-1 -->
  <far-north> Level-1
    <!-- Comment-2 --> Level-2
    <?a-pi pi-2?>
    <north>
         <!-- Comment-3 --> Level-3
         <?a-pi pi-3?>
       <near-north>
            <!-- Comment-4 --> Level-4
            <?a-pi pi-4?>
          <center>
             <near-south-west/>
                   <!-- Comment-5 -->   Level-5
                   <?a-pi pi-5?>
             <near-south>
                      <!-- Comment-6 -->   Level-6
                      <?a-pi pi-6?>
              <south attr1="First" attr2="Last">
                </south>
             </near-south>
          </center>
       </near-north>
    </north>
  </far-north>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy33.xsl
  
  Index: copy33.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy33 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Make each PI be the current node, and copy it. -->
  
  <xsl:template match="/">
    <out>
      <xsl:for-each select="//processing-instruction()">
        <xsl:copy/><xsl:text>
  </xsl:text>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy34.xml
  
  Index: copy34.xml
  ===================================================================
  <?xml version="1.0"?> 
  <OL>
    <LI>item1</LI>
    <LI>item2</LI>
    <OL place="inner">
      <LI>subitem1</LI>
      <LI>subitem2</LI>
    </OL>
  </OL>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy34.xsl
  
  Index: copy34.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy34 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Make an RTF of the whole doc and watch for incorrect xml-decl 
placement. -->
  
  <xsl:template match="/">
    <xsl:variable name="var1">
      <xsl:apply-templates/>
    </xsl:variable>
    <out>
      <xsl:copy-of select="$var1"/>
    </out>
  </xsl:template>
  
  <xsl:template match="*|@*|comment()|processing-instruction()|text()">
    <xsl:copy>
      <xsl:apply-templates 
select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy35.xml
  
  Index: copy35.xml
  ===================================================================
  <?xml version="1.0"?> 
  <OL>
    <LI>item1</LI>
    <LI>item2</LI>
    <OL place="inner">
      <LI>subitem1</LI>
      <LI>subitem2</LI>
    </OL>
  </OL>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy35.xsl
  
  Index: copy35.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy35 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Make a node-set of the whole doc and watch for incorrect 
xml-decl placement. -->
  
  <xsl:template match="/">
    <xsl:variable name="var1">
      <xsl:apply-templates/>
    </xsl:variable>
    <out>
      <xsl:copy-of select="$var1"/>
    </out>
  </xsl:template>
  
  <xsl:template match="*|@*|comment()|processing-instruction()|text()">
    <xsl:copy>
      <xsl:apply-templates 
select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy36.xml
  
  Index: copy36.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- Leave line-breaks as-is -->
  <OUTLINE xmlns:xlink="http://www.w3.org/1999/xlink";><NODE type="book" 
  xlink:href="hello.htm" xlink:type="simple"><LABEL>Hello, world!
  </LABEL></NODE></OUTLINE>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy36.xsl
  
  Index: copy36.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy36 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 Copying -->
    <!-- Creator: <[EMAIL PROTECTED]> -->
    <!-- Purpose: Use prefixed attributes with no preceding text nodes. -->
  
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy37.xml
  
  Index: copy37.xml
  ===================================================================
  <?xml version="1.0" ?>
  <lot>
    <car color="red" make="honda">
      <plate>HJU-789</plate>
    </car>
    <car color="silver" make="honda">
      <plate>HXU-000</plate>
    </car>
    <car color="black" make="honda">
      <plate>ZXU-040</plate>
    </car>
  </lot>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy37.xsl
  
  Index: copy37.xsl
  ===================================================================
  <?xml version="1.0" ?>
  <xsl:stylesheet version='1.0' 
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  
    <!-- FileName: copy37 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: Tom Amiro -->
    <!-- Purpose: Look for bug in building union for identity transform. -->
  
  <xsl:template match="/lot">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="*|@*|comment()|processing-instruction()|text()">
    <xsl:copy>
      <xsl:apply-templates 
select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy38.xml
  
  Index: copy38.xml
  ===================================================================
  <?xml version="1.0" ?>
  <results group="A">
    <match>
      <date>10-Jun-98</date>
      <team score="2">Brazil</team>
      <team score="1">Scotland</team>
    </match>
    <match>
      <date>10-Jun-98</date>
      <team score="2">Morocco</team>
      <team score="2">Norway</team>
    </match>
    <match>
      <date>16-Jun-98</date>
      <team score="1">Scotland</team>
      <team score="1">Norway</team>
    </match>
    <match>
      <date>16-Jun-98</date>
      <team score="3">Brazil</team>
      <team score="0">Morocco</team>
    </match>
    <match>
      <date>23-Jun-98</date>
      <team score="1">Brazil</team>
      <team score="2">Norway</team>
    </match>
    <match>
      <date>23-Jun-98</date>
      <team score="0">Scotland</team>
      <team score="3">Morocco</team>
    </match>
  </results>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy38.xsl
  
  Index: copy38.xsl
  ===================================================================
  <?xml version="1.0" ?>
  <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  
    <!-- FileName: copy38 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: Michael Kay -->
    <!-- Purpose: Using copy-of for repeated output of an RTF (HTML output) -->
  
    <!-- Source Attribution: This test was written by Michael Kay and is taken 
from
         'XSLT Programmer's Reference' published by Wrox Press Limited in 2000;
         ISBN 1-861003-12-9; copyright Wrox Press Limited 2000; all rights 
reserved.
         Now updated in the second edition (ISBN 1-861005-06-7), 
http://www.wrox.com.
         No part of this book may be reproduced, stored in a retrieval system 
or transmitted
         in any form or by any means - electronic, electrostatic, mechanical, 
photocopying,
         recording or otherwise - without the prior written permission of the 
publisher,
         except in the case of brief quotations embodied in critical articles 
or reviews. -->
    <!-- Origin: copy-of/soccer.xml, copy-of/soccer.xsl, Chapter/Page: 4-185, 
was MK015 before -->
  
  <xsl:output method="html"/>
  
  <xsl:variable name="table-heading">
    <tr>
      <td><b>Date</b></td>
      <td><b>Home Team</b></td>
      <td><b>Away Team</b></td>
      <td><b>Result</b></td>
    </tr>
  </xsl:variable>
  
  <xsl:template match="/">
    <html>
      <body>
        <h1>Matches in Group <xsl:value-of select="/*/@group"/></h1>
  
        <xsl:for-each select="//match">
  
          <h2><xsl:value-of select="concat(team[1], ' versus ', team[2])"/></h2>
  
          <table bgcolor="#cccccc" border="1" cellpadding="5">
            <xsl:copy-of select="$table-heading"/><!-- This is the test! -->
            <tr>
              <td><xsl:value-of select="date"/>&#xa0;</td>
              <td><xsl:value-of select="team[1]"/>&#xa0;</td>
              <td><xsl:value-of select="team[2]"/>&#xa0;</td>
              <td><xsl:value-of select="concat(team[1]/@score, '-', 
team[2]/@score)"/>&#xa0;</td>
            </tr>
          </table>
        </xsl:for-each>
      </body>
    </html>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy39.xml
  
  Index: copy39.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <OL>
    <LI>item1</LI>
    <LI attrib="2">item2</LI>
    <LI>item3</LI>
    <OL>
      <LI>subitem1</LI>
      <LI attrib="2">subitem2</LI>
      <!-- Now go deeper -->
      <OL>
        <LI>subitem3</LI>
      </OL>
    </OL>
    <?a-pi some data?>
  </OL>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy39.xsl
  
  Index: copy39.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy39 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 7.5 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Another style of identity transform, where attributes are 
copied
     by copy-of rather than by recursive use of the template. -->
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="node()">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy40.xml
  
  Index: copy40.xml
  ===================================================================
  <?xml version="1.0"?>
  <docs>
    <doc1>
      <a level="1" origin="house">1a1</a>
      <a level="1" origin="Albany">1a2</a>
      <doc1supplement>
        <a level="1" origin="Austin">1xa1</a>
      </doc1supplement>
    </doc1>
    <doc2>
      <a level="2" origin="Baltimore">2a1</a>
      <b level="2" origin="Albany">2b1</b>
      <a level="2" origin="Portland">2a2</a>
      <a level="2" origin="Albany">2a3</a>
      <doc2supplement>
        <a level="3" origin="Chicago">2xa1</a>
        <a level="3" origin="Albany">2xa2</a>
        <a level="3" origin="Albany">2xa3</a>
        <d level="3" origin="Albany">2xd1</d>
      </doc2supplement>
    </doc2>
  </docs>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy40.xsl
  
  Index: copy40.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy40 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 Using Values of Variables & Parameters with xsl:copy-of. 
-->
    <!-- Creator: David Marston -->
    <!-- Purpose: Use key() to get nodes from various places, then copy and 
mark. -->
  
  <xsl:key name="k" use="@origin" match="a" />
  
  <xsl:template match="/">
    <out>
      <xsl:for-each select="key('k','Albany')">
        <xsl:copy>
          <xsl:copy-of select="@level"/>
          <xsl:attribute name="data"><!-- Mark copied 'a' nodes with their data 
-->
            <xsl:value-of select="text()"/>
          </xsl:attribute>
        </xsl:copy><xsl:text>
  </xsl:text>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy41.xml
  
  Index: copy41.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <!-- XYZ -->
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy41.xsl
  
  Index: copy41.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: COPY41 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Try to copy a comment before there is any element produced. 
-->
  
  <xsl:output method="xml" encoding="UTF-8"/>
  
  <xsl:template match="/">
    <xsl:copy-of select="doc/comment()"/>
    <out/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy42.xml
  
  Index: copy42.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <part1>
      <a2 pick="yes">
        <a3 x="a3-1" ordering="7">
          <a4 x="a4-1">7</a4>
        </a3>
        <a3 x="a3-2" ordering="3">
          <a4 x="a4-2">3</a4>
        </a3>
        <a3 x="a3-3" ordering="9">
          <a4 x="a4-3">9</a4>
        </a3>
      </a2>
      <a2 pick="no">
        <a3 x="a3-4" ordering="0">
          <a4 x="a4-4">0</a4>
        </a3>
      </a2>
    </part1>
    <part2>
      <a2 pick="yes">
        <a3 x="a3-5" ordering="2">
          <a4 x="a4-5">2</a4>
        </a3>
        <a3 x="a3-6" ordering="8">
          <a4 x="a4-6">8</a4>
          <a4 x="a4-7">8x</a4>
        </a3>
        <a3 x="a3-7" ordering="5">
          <a4 x="a4-8">5</a4>
        </a3>
      </a2>
      <a2 pick="no">
        <a3 x="a3-8" ordering="0">
          <a4 x="a4-9">0</a4>
        </a3>
      </a2>
    </part2>
  </doc>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy42.xsl
  
  Index: copy42.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy42 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Demonstrate sorting of tree fragments -->
  
  <xsl:template match="/">
    <out>
      <xsl:for-each select="doc//a3[../@pick='yes']">
        <xsl:sort select="@ordering" data-type="number"/>
        <xsl:copy-of select="."/>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy43.xml
  
  Index: copy43.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <OL>
    <LI>item1</LI>
    <LI attrib="2">item2</LI>
    <LI>item3</LI>
    <OL>
      <LI>subitem1</LI>
      <LI attrib="2">subitem2</LI>
      <!-- Now go deeper -->
      <OL>
        <LI>subitem3</LI>
      </OL>
    </OL>
    <?a-pi some data?>
  </OL>
  
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy43.xsl
  
  Index: copy43.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy43 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Copy the whole input tree to non-root position in output.
       "a root node is copied by copying its children" -->
  
  <xsl:template match="/">
    <out>
      <xsl:copy-of select="/" />
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy44.xml
  
  Index: copy44.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <doc xmlns:foo="http://foo.test.com";>
    <bar xmlns:yow="http://yow.test.com";>18 Generic Ave.</bar>
    <foo:bar>157 Fourth St.</foo:bar>
    <wonder:bar xmlns:wonder="http://wonder.com";>777 Broadway</wonder:bar>
    <bar xmlns:huh="http://unknown.com";>12 Slammin Ave.</bar>
    <joes:bar xmlns:joes="http://joes.com";>17 Generic Ave.</joes:bar>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy44.xsl
  
  Index: copy44.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
      xmlns:foo="http://foo.test.com";
      xmlns:joes="http://joes.com";
      exclude-result-prefixes="foo huh">
  
    <!-- FileName: copy44 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Introduce namespace nodes through copy-of (i.e., no earlier 
reference). -->
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates select="doc"/>
    </out>
  </xsl:template>
  
  <xsl:template match="doc">
    <union>
      <xsl:copy-of select="bar | joes:bar" />
    </union>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy45.xml
  
  Index: copy45.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc></doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy45.xsl
  
  Index: copy45.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: copy45 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.3 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Make an RTF on the fly and watch for incorrect xml-decl 
placement. -->
  
  <xsl:output method="xml" encoding="UTF-8" standalone="yes" />
  
  <xsl:template match="/">
    <xsl:variable name="var1"><rtf>abc<in 
x="yz">def</in>ghi</rtf></xsl:variable>
    <out>
      <xsl:copy-of select="$var1"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy46.xml
  
  Index: copy46.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <doc xmlns:foo="http://foo.test.com";>
    <bar xmlns:yow="http://yow.test.com";>18 Generic Ave.</bar>
    <foo:bar>157 Fourth St.</foo:bar>
    <wonder:bar xmlns:wonder="http://wonder.com";>777 Broadway</wonder:bar>
    <bar xmlns:huh="http://unknown.com";>12 Slammin Ave.</bar>
    <joes:bar xmlns:joes="http://joes.com";>17 Generic Ave.</joes:bar>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/copy/copy46.xsl
  
  Index: copy46.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
      xmlns:foo="http://foo.test.com";
      xmlns:joes="http://joes.com";
      xmlns:huh="http://unknown.com";>
  
    <!-- FileName: copy46 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Introduce namespace nodes through copy-of where select 
ignores namespace. -->
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates select="doc"/>
    </out>
  </xsl:template>
  
  <xsl:template match="doc">
    <star>
      <xsl:copy-of select="*[local-name()='bar']" />
    </star>
  </xsl:template>
  
  </xsl:stylesheet>
  
  

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

Reply via email to