diff --git a/ChangeLog b/ChangeLog index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_Q2hhbmdlTG9n..c2a1002a6635c994d7df257c8a7bc91c4a520701_Q2hhbmdlTG9n 100644 --- 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 diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_bGlieHNsdC9wYXR0ZXJuLmM=..c2a1002a6635c994d7df257c8a7bc91c4a520701_bGlieHNsdC9wYXR0ZXJuLmM= 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -301,7 +301,25 @@ 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); diff --git a/tests/general/bug-142.out b/tests/general/bug-142.out index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_dGVzdHMvZ2VuZXJhbC9idWctMTQyLm91dA==..c2a1002a6635c994d7df257c8a7bc91c4a520701_dGVzdHMvZ2VuZXJhbC9idWctMTQyLm91dA== 100644 --- a/tests/general/bug-142.out +++ b/tests/general/bug-142.out @@ -1,6 +1,6 @@ <?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 @@ -3,7 +3,7 @@ <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> @@ -8,6 +8,6 @@ <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> diff --git a/tests/general/bug-152.out b/tests/general/bug-152.out index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_dGVzdHMvZ2VuZXJhbC9idWctMTUyLm91dA==..c2a1002a6635c994d7df257c8a7bc91c4a520701_dGVzdHMvZ2VuZXJhbC9idWctMTUyLm91dA== 100644 --- a/tests/general/bug-152.out +++ b/tests/general/bug-152.out @@ -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> diff --git a/tests/general/bug-89.xsl b/tests/general/bug-89.xsl index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_dGVzdHMvZ2VuZXJhbC9idWctODkueHNs..c2a1002a6635c994d7df257c8a7bc91c4a520701_dGVzdHMvZ2VuZXJhbC9idWctODkueHNs 100644 --- a/tests/general/bug-89.xsl +++ b/tests/general/bug-89.xsl @@ -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> diff --git a/tests/namespaces/tst7.out b/tests/namespaces/tst7.out index 865848df0a2ce948ae1dcfc2cf0f3e913eef5cbf_dGVzdHMvbmFtZXNwYWNlcy90c3Q3Lm91dA==..c2a1002a6635c994d7df257c8a7bc91c4a520701_dGVzdHMvbmFtZXNwYWNlcy90c3Q3Lm91dA== 100644 --- a/tests/namespaces/tst7.out +++ b/tests/namespaces/tst7.out @@ -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>