added comments and function header, improved logic of routine just added.
authorWilliam M. Brack <wbrack@src.gnome.org>
Mon, 3 May 2004 07:19:36 +0000 (07:19 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Mon, 3 May 2004 07:19:36 +0000 (07:19 +0000)
* libxslt/imports.c: added comments and function header,
  improved logic of routine just added.
* tests/general/bug-147*, tests/docs/bug-147.xml,
  tests/general/Makefile.am, tests/docs/Makefile.am: added
  regression test for bug 141279

13 files changed:
ChangeLog
libxslt/imports.c
tests/docs/Makefile.am
tests/docs/bug-147.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-147-1.imp [new file with mode: 0644]
tests/general/bug-147-2.imp [new file with mode: 0644]
tests/general/bug-147-3.imp [new file with mode: 0644]
tests/general/bug-147-4.imp [new file with mode: 0644]
tests/general/bug-147-5.imp [new file with mode: 0644]
tests/general/bug-147-6.imp [new file with mode: 0644]
tests/general/bug-147.out [new file with mode: 0644]
tests/general/bug-147.xsl [new file with mode: 0644]

index 75a2127..65b439a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun May  2 23:47:43 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/imports.c: added comments and function header,
+         improved logic of routine just added.
+       * tests/general/bug-147*, tests/docs/bug-147.xml,
+         tests/general/Makefile.am, tests/docs/Makefile.am: added
+         regression test for bug 141279
+
 Sun May  2 12:47:32 PDT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/imports.c: enhanced normalization of comp steps
index 85b62cf..21dca74 100644 (file)
  *                     Module interfaces                               *
  *                                                                     *
  ************************************************************************/
+/**
+ * xsltFixImportedCompSteps:
+ * @master: the "master" stylesheet
+ * @style: the stylesheet being imported by the master
+ *
+ * normalize the comp steps for the stylesheet being imported
+ * by the master, together with any imports within that. 
+ *
+ */
 static void xsltFixImportedCompSteps(xsltStylesheetPtr master, 
                        xsltStylesheetPtr style) {
     xsltStylesheetPtr res;
-    for (res = style; res != NULL; res = res->imports)
-       xmlHashScan(res->templatesHash,
+    xmlHashScan(style->templatesHash,
                    (xmlHashScanner) xsltNormalizeCompSteps, master);
-    master->extrasNr += style->extrasNr;
+    for (res = style->imports; res != NULL; res = res->next)
+       xsltFixImportedCompSteps(master, res);
 }
 
 /**
@@ -143,6 +152,7 @@ xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) {
        res->next = style->imports;
        style->imports = res;
        xsltFixImportedCompSteps(style, res);
+       style->extrasNr += res->extrasNr;
        ret = 0;
     } else {
        xmlFreeDoc(import);
index 85f94ba..5c57fcd 100644 (file)
@@ -146,6 +146,7 @@ EXTRA_DIST =        \
        bug-144.xml \
        bug-145.xml \
        bug-146.xml \
+       bug-147.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-147.xml b/tests/docs/bug-147.xml
new file mode 100644 (file)
index 0000000..d3a1768
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" standalone="yes"?>
+<dokument>
+<paragraph>
+<liste>
+<le>abc</le>
+</liste>
+</paragraph>
+<navigation location="bottom">
+<interestguide>
+<index>
+<link type="internal" text="Allgemein">
+<action name="ChangeBGColor" event="onMouseOver">
+<pass-param name="color" value="#f9e84a"/>
+</action>
+<action name="ChangeBGColor" event="onMouseOut"><pass-param name="color" 
+value="#ffffff"/></action>
+</link>
+</index>
+</interestguide>
+</navigation>
+</dokument>
index 4bd304c..202adda 100644 (file)
@@ -152,6 +152,9 @@ EXTRA_DIST = \
     bug-144.out bug-144.xsl \
     bug-145.out bug-145.xsl bug-145.err \
     bug-146.out bug-146.xsl \
+    bug-147.out bug-147.xsl \
+    bug-147-1.imp bug-147-2.imp bug-147-3.imp \
+    bug-147-4.imp bug-147-5.imp bug-147-6.imp \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-147-1.imp b/tests/general/bug-147-1.imp
new file mode 100644 (file)
index 0000000..764f0ef
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+                
+<xsl:template match="dokument">
+  <xsl:text>template#1 in module#1;</xsl:text>
+  <xsl:apply-templates select="paragraph"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-2.imp b/tests/general/bug-147-2.imp
new file mode 100644 (file)
index 0000000..86aa3b5
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+     
+<xsl:template match="interestguide">
+  <xsl:text>template#1 in module#2;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-3.imp b/tests/general/bug-147-3.imp
new file mode 100644 (file)
index 0000000..89444c8
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="numliste">
+  <xsl:text>template#1 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="numliste-u">
+  <xsl:text>template#2 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="liste | liste-u">
+  <xsl:text>template#3 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="numliste[@startindex] | numliste-u[@startindex]">
+  <xsl:text>template#4 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='strich'] | 
+                     le[parent::liste or parent::liste-u][not
+(parent::*/@typ)]">
+  <xsl:text>template#5 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='punkt']">
+  <xsl:text>template#6 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='kasten']">
+  <xsl:text>template#7 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='arabisch'] | 
+                     le[parent::numliste or parent::numliste-u][not
+(parent::*/@typ)]">
+  <xsl:text>template#8 in module#3;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-4.imp b/tests/general/bug-147-4.imp
new file mode 100644 (file)
index 0000000..af2b006
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="./bug-147-5.imp"/>
+
+     
+<xsl:template match="action[@name='ShowPage']
+                           [@event='onClick']
+                           [pass-param/@name='pageid']">
+  <xsl:text>template#1 in module#4;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-5.imp b/tests/general/bug-147-5.imp
new file mode 100644 (file)
index 0000000..48515c1
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="./bug-147-6.imp"/>
+
+     
+<xsl:template match="action[@name='ShowPage']
+                           [@event='onClick']
+                           [pass-param/@name='pageid']">
+  <xsl:text>template#1 in module#5;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ChangeBGColor']
+                           [@event='onMouseOver']">
+  <xsl:text>template#2 in module#5;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ChangeBGColor']
+                           [@event='onMouseOut']">
+  <xsl:text>template#3 in module#5;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-6.imp b/tests/general/bug-147-6.imp
new file mode 100644 (file)
index 0000000..b6b52d0
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="action[@name='ShowPage']
+                           [@event='onClick']                                
+                           [pass-param/@name='pagenum']">
+  <xsl:text>template#1 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ShowPage']
+                           [@event='onClick']
+                           [pass-param/@name='pageid']">
+  <xsl:text>template#2 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ShowInfoText']
+                           [@event='onCreate']">
+  <xsl:text>template#3 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="pass-param"
+              mode="invlink">
+  <xsl:text>template#4 in module#6;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147.out b/tests/general/bug-147.out
new file mode 100644 (file)
index 0000000..46963a8
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
+<body><div>template#1 in module#1;
+template#3 in module#3;
+template#5 in module#3;abc
+
+
+template#1 in module#2;
+
+
+template#2 in module#5;
+template#3 in module#5;
+
+
+
+</div></body>
+</html>
diff --git a/tests/general/bug-147.xsl b/tests/general/bug-147.xsl
new file mode 100644 (file)
index 0000000..70b5473
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+                
+<xsl:import href="./bug-147-3.imp"/>
+<xsl:import href="./bug-147-2.imp"/>
+<xsl:import href="./bug-147-1.imp"/>
+<xsl:import href="./bug-147-4.imp"/>
+
+
+<xsl:output method="html"/>
+
+
+<xsl:template match="/">
+  <html>
+    <head></head>
+    <body><xsl:apply-templates select="/dokument"/></body>
+  </html>
+</xsl:template>
+
+
+<xsl:template match="dokument">
+  <div>
+    <xsl:apply-imports/>
+    <xsl:apply-templates select="navigation[@location='bottom']"/>
+  </div>
+</xsl:template>
+
+</xsl:stylesheet>