dmarston    01/11/21 08:34:42

  Modified:    test/tests/conf/impincl s.xsl c.xsl d.xsl e.xsl f.xsl g.xsl
                        impincl02.xsl impincl05.xsl impincl06.xsl
                        impincl07.xml impincl07.xsl impincl14.xml
                        impincl14.xsl l.xsl r.xsl b.xsl
  Added:       test/tests/conf/impincl impincl12.xml impincl12.xsl
                        impincl13.xml impincl13.xsl impincl20.xml
                        impincl20.xsl impincl21.xml impincl21.xsl
                        impincl22.xml impincl22.xsl impincl23.xml
                        impincl23.xsl impincl24.xml impincl24.xsl
  Log:
  Overhaul apply-imports testing
  
  Revision  Changes    Path
  1.2       +4 -1      xml-xalan/test/tests/conf/impincl/s.xsl
  
  Index: s.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/s.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- s.xsl     2000/12/16 01:12:38     1.1
  +++ s.xsl     2001/11/21 16:34:40     1.2
  @@ -1,5 +1,8 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: s -->
  +<!-- Purpose: Used by impincl15. -->
  +
   <xsl:template match="tag" mode="yes">
     <pre><xsl:apply-templates/></pre>
   </xsl:template>
  @@ -12,4 +15,4 @@
     <unmoded><xsl:apply-templates/></unmoded>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +11 -8     xml-xalan/test/tests/conf/impincl/c.xsl
  
  Index: c.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/c.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- c.xsl     2000/12/16 01:12:38     1.1
  +++ c.xsl     2001/11/21 16:34:40     1.2
  @@ -1,16 +1,19 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  +
  +<!-- FileName: c -->
  +<!-- Purpose: Used by impincl05, 06, 07, 12, 14 -->
  +
   <xsl:import href="e.xsl"/>
   
   <xsl:template match="title">
  -  C-title:<xsl:text>,</xsl:text>
  +  C-title: <xsl:value-of select="."/>
     <xsl:apply-imports/>
   </xsl:template>
  -  
  +
   <xsl:template match="chapters">
  -  C-chapters:
  -  <xsl:apply-imports/>
  -</xsl:template> 
  +  C-chapters: <xsl:apply-templates select="chapter"/>
  +  <xsl:text>&#10;</xsl:text>
  +</xsl:template>
   
  -     
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +8 -6      xml-xalan/test/tests/conf/impincl/d.xsl
  
  Index: d.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/d.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- d.xsl     2000/12/16 01:12:38     1.1
  +++ d.xsl     2001/11/21 16:34:40     1.2
  @@ -1,13 +1,15 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: d -->
  +<!-- Purpose: Used by b.xsl, which is used by several tests. -->
  +
   <xsl:template match="title">
  -  D-title:
  -</xsl:template> 
  +  D-title: <xsl:value-of select="."/>
  +</xsl:template>
   
   <xsl:template match="overview">
  -  D-overview: 
  -  <xsl:value-of select="."/>
  +  D-overview: <xsl:value-of select="."/>
   </xsl:template>
  -   
  +
   </xsl:stylesheet>
  
  
  
  1.2       +9 -7      xml-xalan/test/tests/conf/impincl/e.xsl
  
  Index: e.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/e.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- e.xsl     2000/12/16 01:12:38     1.1
  +++ e.xsl     2001/11/21 16:34:40     1.2
  @@ -1,14 +1,16 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: e -->
  +<!-- Purpose: Used by c.xsl, which is used by several tests. -->
  +
   <xsl:template match="title">
  -  E-title:<xsl:text>,</xsl:text>
  +  E-title: <xsl:value-of select="."/>
   </xsl:template>
   
   <xsl:template match="chapter">
  -  E-chapter: 
  -  <xsl:value-of select="@num"/><xsl:text>.</xsl:text>  
  +    E-chapter <xsl:value-of select="@num"/><xsl:text>: </xsl:text>
     <xsl:value-of select="."/>
  -</xsl:template> 
  -   
  -</xsl:stylesheet>
  +</xsl:template>
  +
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +7 -0      xml-xalan/test/tests/conf/impincl/f.xsl
  
  Index: f.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/f.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- f.xsl     2000/12/16 01:12:38     1.1
  +++ f.xsl     2001/11/21 16:34:40     1.2
  @@ -1,5 +1,12 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: f -->
  +<!-- Purpose: Used by impincl02 -->
  +
   <xsl:import href="g.xsl"/>
  +
  +<xsl:template match="foo">
  +  <good-match sheet="f"/>
  +</xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.2       +4 -1      xml-xalan/test/tests/conf/impincl/g.xsl
  
  Index: g.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/g.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- g.xsl     2000/12/16 01:12:38     1.1
  +++ g.xsl     2001/11/21 16:34:40     1.2
  @@ -1,7 +1,10 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: g -->
  +<!-- Purpose: Used indirectly by impincl02, etc. -->
  +
   <xsl:template match="foo">
  -  <bad-match/>
  +  <bad-match sheet="g"/>
   </xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.2       +6 -8      xml-xalan/test/tests/conf/impincl/impincl02.xsl
  
  Index: impincl02.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl02.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl02.xsl     2000/12/16 01:12:38     1.1
  +++ impincl02.xsl     2001/11/21 16:34:40     1.2
  @@ -3,19 +3,17 @@
   
     <!-- FileName: IMPINCL02 -->
     <!-- Document: http://www.w3.org/TR/xslt -->
  -  <!-- DocVersion: 19990922 -->
  +  <!-- DocVersion: 19991116 -->
     <!-- Section: 2.6 Combining Stylesheets -->
  -  <!-- Purpose: Included document's xsl:import (f imports g) is 
  -       moved into the including document. Import precedence is 
  -       impincl02, g, h -->
  +  <!-- Purpose: Included document's xsl:import (f imports g) is moved into 
the
  +    including document. Import precedence is (high) impincl02, g (low) -->
   
  -<xsl:import href="h.xsl"/>
   <xsl:include href="f.xsl"/>
   
  -<xsl:template match="foo">
  +<xsl:template match="/">
     <out>
  -    <good-match/>
  +    <xsl:apply-templates select="foo"/>
     </out>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +9 -11     xml-xalan/test/tests/conf/impincl/impincl05.xsl
  
  Index: impincl05.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl05.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl05.xsl     2000/12/16 01:12:38     1.1
  +++ impincl05.xsl     2001/11/21 16:34:40     1.2
  @@ -1,25 +1,23 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
     <!-- FileName: IMPINCL05 -->
     <!-- Document: http://www.w3.org/TR/xslt -->
  -  <!-- DocVersion: 19990922 -->
  +  <!-- DocVersion: 19991116 -->
     <!-- Section: 2.6.2 -->
  -  <!-- Purpose: Two imports, each of which has an import, plus an 
  -       apply-imports in main stylesheet. -->
  +  <!-- Purpose: Two imports, each of which has an import, plus an
  +       apply-imports in main stylesheet. Precedence (low) DBECA (high) per 
spec. -->
   
   <xsl:import href="b.xsl"/>
   <xsl:import href="c.xsl"/>
   
   <xsl:template match="/">
  -  <out>
  -    <xsl:apply-templates/>
  -  </out>
  +  <out><xsl:apply-templates select="doc/*" /></out>
   </xsl:template>
  - 
  -<xsl:template match="title">
  -  Import01-title<xsl:text>,</xsl:text>
  +
  +<xsl:template match="title"><!-- This has import precedence over all others 
-->
  +  MAIN title matched<xsl:text>...</xsl:text>
     <xsl:apply-imports/>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +19 -17    xml-xalan/test/tests/conf/impincl/impincl06.xsl
  
  Index: impincl06.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl06.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl06.xsl     2000/12/16 01:12:38     1.1
  +++ impincl06.xsl     2001/11/21 16:34:40     1.2
  @@ -1,29 +1,31 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
     <!-- FileName: IMPINCL06 -->
     <!-- Document: http://www.w3.org/TR/xslt -->
  -  <!-- DocVersion: 19990922 -->
  +  <!-- DocVersion: 19991116 -->
     <!-- Section: 2.6 -->
  -  <!-- Purpose: Two includes, each of which has an import. -->
  +  <!-- Purpose: Two includes (see below), each of which has an import. -->
   
  -<xsl:include href="b.xsl"/>
  -<xsl:include href="c.xsl"/>
  -
  -<xsl:template match="/*">
  -  <out>
  -    <xsl:apply-templates/>
  -  </out>
  +<xsl:template match="/">
  +  <out><xsl:apply-templates select="doc/*" /></out>
   </xsl:template>
  - 
  -<xsl:template match="title">
  -  Includ01-title: 
  -  <xsl:apply-templates/>
  +
  +<xsl:template match="author">
  +  MAIN author: <xsl:text>How did THIS get called?</xsl:text>
   </xsl:template>
   
  -<xsl:template match="chapter">
  -  <xsl:value-of select="@num"/> .  
  +<xsl:template match="chapter"><!-- This has import precedence over e.xsl -->
  +    MAIN chapter <xsl:value-of select="@num"/><xsl:text>: </xsl:text>
     <xsl:value-of select="."/>
   </xsl:template>
  +
  +<!-- INCLUDES can be anywhere and are positionally significant -->
  +<xsl:include href="b.xsl"/>
  +<xsl:include href="c.xsl"/>
  +
  +<xsl:template match="title"><!-- This has import precedence over d.xsl, plus 
it's last -->
  +  MAIN title matched<xsl:text>...</xsl:text>
  +</xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +1 -0      xml-xalan/test/tests/conf/impincl/impincl07.xml
  
  Index: impincl07.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl07.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl07.xml     2000/12/16 01:12:38     1.1
  +++ impincl07.xml     2001/11/21 16:34:40     1.2
  @@ -2,6 +2,7 @@
   <doc>
   <title>Testing:import-precedence</title>
   <author>Joe Jones</author>
  +<author>Milt Hinton</author>
   <overview>testing-import</overview>
   <chapters>
   <chapter num="1">know xsl</chapter>
  
  
  
  1.2       +9 -12     xml-xalan/test/tests/conf/impincl/impincl07.xsl
  
  Index: impincl07.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl07.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl07.xsl     2000/12/16 01:12:38     1.1
  +++ impincl07.xsl     2001/11/21 16:34:40     1.2
  @@ -1,25 +1,22 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
     <!-- FileName: IMPINCL07 -->
     <!-- Document: http://www.w3.org/TR/xslt -->
  -  <!-- DocVersion: 19990922 -->
  +  <!-- DocVersion: 19991116 -->
     <!-- Section: 2.6.2 -->
  -  <!-- Purpose: Two imports, each of which has an import, 
  -       plus an apply-imports in main stylesheet. -->
  +  <!-- Purpose: Show the significance of the order of xsl:import 
declarations. -->
   
  -<xsl:import href="b.xsl"/>
   <xsl:import href="c.xsl"/>
  +<xsl:import href="b.xsl"/>
   
   <xsl:template match="/">
  -  <out>
  -    <xsl:apply-templates/>
  -  </out>
  +  <out><xsl:apply-templates select="doc/*" /></out>
   </xsl:template>
  - 
  -<xsl:template match="title">
  -  Import01-title<xsl:text>,</xsl:text>
  +
  +<xsl:template match="title"><!-- This has import precedence over all others 
-->
  +  MAIN title matched<xsl:text>...</xsl:text>
     <xsl:apply-imports/>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +2 -2      xml-xalan/test/tests/conf/impincl/impincl14.xml
  
  Index: impincl14.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl14.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl14.xml     2000/12/16 01:12:39     1.1
  +++ impincl14.xml     2001/11/21 16:34:40     1.2
  @@ -1,8 +1,8 @@
   <?xml version="1.0"?>
   <doc>
  -  <title>Testing-xsl:include</title>
  +  <title>Testing:apply-imports</title>
     <author>Joe Jones</author>
  -  <overview>testing-include</overview>
  +  <overview>No templates for this part.</overview>
     <chapters>
       <chapter num="1">know xsl</chapter>
       <chapter num="2">love xsl</chapter>
  
  
  
  1.2       +3 -3      xml-xalan/test/tests/conf/impincl/impincl14.xsl
  
  Index: impincl14.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/impincl14.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- impincl14.xsl     2000/12/16 01:12:39     1.1
  +++ impincl14.xsl     2001/11/21 16:34:40     1.2
  @@ -8,7 +8,7 @@
     <!-- Creator: David Marston -->
     <!-- Purpose: Show that apply-imports has limited scope of rules to 
search. -->
     <!-- "xsl:apply-imports processes the current node using only template 
rules that
  -     were imported into the stylesheet CONTAINING THE CURRENT TEMPLATE 
RULE...." 
  +     were imported into the stylesheet CONTAINING THE CURRENT TEMPLATE 
RULE...."
        The apply-imports will be done in c.xsl; rules from r won't apply at 
that time. -->
   
   <xsl:import href="r.xsl"/>
  @@ -16,8 +16,8 @@
   
   <xsl:template match="doc">
     <out>
  -    <xsl:apply-templates/>
  +    <xsl:apply-templates select="title"/><!-- c, e, r all have templates for 
this. -->
     </out>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +5 -2      xml-xalan/test/tests/conf/impincl/l.xsl
  
  Index: l.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/l.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- l.xsl     2000/12/16 01:12:39     1.1
  +++ l.xsl     2001/11/21 16:34:40     1.2
  @@ -1,7 +1,10 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: l -->
  +<!-- Purpose: Used by impincl10 -->
  +
   <xsl:template match="tag">
  -     <pre><xsl:apply-templates/></pre>
  +  <pre><xsl:apply-templates/></pre>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +5 -6      xml-xalan/test/tests/conf/impincl/r.xsl
  
  Index: r.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/r.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- r.xsl     2000/12/16 01:12:39     1.1
  +++ r.xsl     2001/11/21 16:34:40     1.2
  @@ -1,16 +1,15 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
   
  +<!-- FileName: r -->
  +<!-- Purpose: Used by impincl14. -->
  +
   <xsl:template match="title">
     <xsl:text>R-title shouldn't be used</xsl:text>
   </xsl:template>
   
   <xsl:template match="author">
     R-author:<xsl:value-of select="."/>
  -</xsl:template> 
  -
  -<xsl:template match="chapter">
  -  <xsl:text>R-chapter shouldn't be used</xsl:text>
   </xsl:template>
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.2       +9 -5      xml-xalan/test/tests/conf/impincl/b.xsl
  
  Index: b.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/tests/conf/impincl/b.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- b.xsl     2000/12/16 01:12:39     1.1
  +++ b.xsl     2001/11/21 16:34:40     1.2
  @@ -1,10 +1,14 @@
  -<?xml version="1.0"?> 
  +<?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  +
  +<!-- FileName: b -->
  +<!-- Purpose: Used by impincl05, 06, 07 -->
  +
   <xsl:import href="d.xsl"/>
   
   <xsl:template match="author">
  -  B-author:  
  -  <xsl:apply-imports/><xsl:text>,</xsl:text>
  +  B-author: <xsl:apply-imports/><xsl:text>,</xsl:text>
  +  <!-- No other author templates, so built-in will be used. -->
   </xsl:template>
  -   
  -</xsl:stylesheet>
  +
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.3       +9 -13     xml-xalan/test/tests/conf/impincl/impincl12.xml
  
  
  
  
  1.4       +17 -11    xml-xalan/test/tests/conf/impincl/impincl12.xsl
  
  
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl13.xml
  
  Index: impincl13.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
  <title>Testing include</title>
  <author>Joe Jones</author>
  <overview x="y">testing apply-imports from include</overview>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl13.xsl
  
  Index: impincl13.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: impincl13 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.6 -->
    <!-- Creator: David Marston, from an idea by Norm Walsh -->
    <!-- Purpose: Show that included templates doing apply-imports *will* get 
includer's import tree. -->
  
  <xsl:import href="fragments/i13imp.xsl"/>
  <xsl:include href="fragments/i13incl.xsl"/>
  
  <xsl:template match="/">
    <out><xsl:apply-templates select="doc/*" /></out>
  </xsl:template>
  
  <xsl:template match="author">
    MAIN author: <xsl:value-of select="."/>
    <xsl:apply-imports/>
  </xsl:template>
  
  <xsl:template match="title"><!-- This is last, so it wins out over the 
imports/includes -->
    MAIN title: <xsl:value-of select="."/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl20.xml
  
  Index: impincl20.xml
  ===================================================================
  <?xml version="1.0"?> 
  <foo>
    <bar>
      <baz/>
    </bar>
  </foo>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl20.xsl
  
  Index: impincl20.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  
    <!-- FileName: impincl20 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.6 -->
    <!-- Creator: Morten Jorgensen -->
    <!-- Purpose: Show that apply-imports applies on its matching node, not 
children. -->
  
  <xsl:import href="fragments/imp20b.xsl"/>
  <xsl:import href="fragments/imp20d.xsl"/>
  
  <xsl:template match="/">
    <out>
      <xsl:text>Match on / in top xsl&#xa;</xsl:text>
      <xsl:apply-templates select="foo"/>
    </out>
  </xsl:template>
  
  <xsl:template match="foo">
    <A><xsl:apply-imports/></A>
  </xsl:template>
  
  <xsl:template match="bar">
    <xsl:text>match on bar in top xsl</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl21.xml
  
  Index: impincl21.xml
  ===================================================================
  <?xml version="1.0"?> 
  <doc>
    <foo><bar/></foo>
    <goo><bar/></goo>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl21.xsl
  
  Index: impincl21.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  
    <!-- FileName: impincl21 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.6 -->
    <!-- Creator: Morten Jorgensen -->
    <!-- Purpose: Show selection of templates from files with 1st and 2nd 
import precedence. -->
  
  <xsl:import href="fragments/imp21b.xsl"/>
  <xsl:import href="fragments/imp21d.xsl"/>
  
  <xsl:template match="/doc">
    <out>
      <xsl:text>Match on /doc in top xsl&#xa;</xsl:text>
      <xsl:apply-templates select="*"/>
    </out>
  </xsl:template>
  
  <xsl:template match="foo">
    <A><xsl:apply-imports/></A><xsl:text>&#xa;</xsl:text>
  </xsl:template>
  
  <xsl:template match="goo">
    <A><xsl:apply-imports/></A><xsl:text>&#xa;</xsl:text>
  </xsl:template>
  
  <xsl:template match="bar">
    <xsl:text> - match on bar in top xsl</xsl:text>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl22.xml
  
  Index: impincl22.xml
  ===================================================================
  <?xml version="1.0"?>
  <foo/>
  
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl22.xsl
  
  Index: impincl22.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: impincl22 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.6 Combining Stylesheets -->
    <!-- Creator: David Marston -->
    <!-- Purpose: With two imports, precedence goes to the last one.
      Import precedence for templates matching foo (f imports g) is
      (high) h, f, g (low) -->
  
  <xsl:import href="f.xsl"/>
  <xsl:import href="h.xsl"/>
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates select="foo"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl23.xml
  
  Index: impincl23.xml
  ===================================================================
  <?xml version="1.0"?>
  <foo/>
  
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl23.xsl
  
  Index: impincl23.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: impincl23 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.6 Combining Stylesheets -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Included document's xsl:import (i23incl imports i23sub) is 
moved into the
      including document. Import precedence for templates matching foo is
      (high) i23sub, h (low) -->
  
  <xsl:import href="h.xsl"/>
  <xsl:include href="fragments/i23incl.xsl"/><!-- last one on list has higher 
precedence -->
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates select="foo"/>
    </out>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl24.xml
  
  Index: impincl24.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>
    <tag>Example of apply-imports</tag>
  </doc>
  
  
  1.1                  xml-xalan/test/tests/conf/impincl/impincl24.xsl
  
  Index: impincl24.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <!-- FileName: impincl24 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 5.6 Overriding Template Rules -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Show that global variables are in scope in apply-imports 
templates. -->
  
  <xsl:import href="fragments/i24imp.xsl"/>
  
  <xsl:variable name="color" select="'red'" />
  
  <xsl:template match="doc">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="tag">
    <div style="{concat('border: solid ',$color)}">
      <xsl:apply-imports/>
    </div>
  </xsl:template>
  
  </xsl:stylesheet>
  
  

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

Reply via email to