fixed #303289 variable in match are forbidden had to fix that test which
authorDaniel Veillard <veillard@src.gnome.org>
Sun, 4 Sep 2005 22:09:19 +0000 (22:09 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Sun, 4 Sep 2005 22:09:19 +0000 (22:09 +0000)
* libxslt/pattern.c: fixed #303289 variable in match are forbidden
* tests/general/bug-89.xsl: had to fix that test which was doing this
* tests/general/bug-142.out tests/general/bug-152.out
  tests/namespaces/tst7.out: small output change on libxml2-2.6.21
  new way of serializing encoding meta in HTML
Daniel

ChangeLog
libxslt/pattern.c
tests/general/bug-142.out
tests/general/bug-152.out
tests/general/bug-89.xsl
tests/namespaces/tst7.out

index 4773c81..42c8250 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Sep  5 00:07:40 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/pattern.c: fixed #303289 variable in match are forbidden
+       * tests/general/bug-89.xsl: had to fix that test which was doing this
+       * tests/general/bug-142.out tests/general/bug-152.out
+         tests/namespaces/tst7.out: small output change on libxml2-2.6.21
+         new way of serializing encoding meta in HTML
+
 Wed Aug 31 13:49:51 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/transform.c: fixed 314936 a dictionnary issue on text
index 015d944..97d9a71 100644 (file)
@@ -301,7 +301,25 @@ xsltCompMatchAdd(xsltParserContextPtr ctxt, xsltCompMatchPtr comp,
            xsltAllocateExtra(ctxt->style);
     }
     if (op == XSLT_OP_PREDICATE) {
-       comp->steps[comp->nbStep].comp = xsltXPathCompile(ctxt->style, value);
+       xmlXPathContextPtr xctxt;
+
+       if (ctxt->style != NULL)
+           xctxt = xmlXPathNewContext(ctxt->style->doc);
+       else
+           xctxt = xmlXPathNewContext(NULL);
+       memset(xctxt, 0, sizeof(xctxt));
+#ifdef XML_XPATH_NOVAR
+       xctxt->flags = XML_XPATH_NOVAR;
+#endif
+       if (ctxt->style != NULL)
+           xctxt->dict = ctxt->style->dict;
+       comp->steps[comp->nbStep].comp = xmlXPathCtxtCompile(xctxt, value);
+       xmlXPathFreeContext(xctxt);
+       if (comp->steps[comp->nbStep].comp == NULL) {
+           xsltTransformError(NULL, ctxt->style, ctxt->elem,
+                   "Failed to compile predicate\n");
+           ctxt->style->errors++;
+       }
     }
     comp->nbStep++;
     return (0);
index 269e708..9a09b5e 100644 (file)
@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"><body><div id="post6" xml:lang="ja"><h3><a href="2004/01/26/6">他の日本語の伝言</a></h3>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"><body><div id="post6"><h3><a href="2004/01/26/6">他の日本語の伝言</a></h3>
       <p>この伝言は日本語で書いて、翻訳がある。<span xml:lang="fr">couhin ?</span></p>
       <p>Et on a une petite phrase en français.</p>
     </div>
     Test
-  <div id="post4" xml:lang="ja"><h3><a href="2004/01/25/4">日本語の伝言</a></h3>
+  <div id="post4"><h3><a href="2004/01/25/4">日本語の伝言</a></h3>
       <p>この伝言は日本語で書いて、翻訳がない。実は少しだけ。</p>
       <p>あいうえおかきくけこさしすせそ…</p>
-    </div><div id="post3" xml:lang="ja"><h3><a href="2005/08/12/3"/></h3></div><div id="post2" xml:lang="ja"><h3><a href="2004/01/25/2">間違い</a></h3>
+    </div><div id="post3"><h3><a href="2005/08/12/3"/></h3></div><div id="post2"><h3><a href="2004/01/25/2">間違い</a></h3>
       <p>Quelques tests d'erreurs :</p>
       <ul>
        Un paragraphe dans la liste
@@ -18,7 +18,7 @@
        <li>une <span xml:lang="fr">翻訳</span> sans xml:lang="ja"</li>
        <li>20040125</li>
       </ul>
-    </div><div id="post1" xml:lang="ja"><h3><a href="2004/01/25/1">サンプル</a></h3>
+    </div><div id="post1"><h3><a href="2004/01/25/1">サンプル</a></h3>
       <p>Ceci est un <span xml:lang="ja">テスト</span>.</p>
       <ul>
        <li>Voici une liste,</li>
index 7bdd337..3d23ac9 100644 (file)
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="US-ASCII"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
+  <head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
     <style type="text/css" media="all">@import
 "pretty_xhtml.css";</style>
   </head>
index 4bf4ca1..697cefb 100644 (file)
@@ -30,7 +30,7 @@
 <!-- effacer ! -->
 </xsl:template>
 
-<xsl:template match="*[attribute::id and @id=$targetId]">
+<xsl:template match="*[attribute::id and @id='']">
 <!-- attribute::type pour éviter de confondre l'absence d'attibute et
 la valeur nulle -->
 <xsl:choose>
index b86f605..47cc1e7 100644 (file)
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>
                                         A title
                                 </title>