diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libxslt/pattern.c | 20 | ||||
-rw-r--r-- | tests/general/bug-142.out | 8 | ||||
-rw-r--r-- | tests/general/bug-152.out | 3 | ||||
-rw-r--r-- | tests/general/bug-89.xsl | 2 | ||||
-rw-r--r-- | tests/namespaces/tst7.out | 3 |
6 files changed, 34 insertions, 10 deletions
@@ -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 015d9446..97d9a71a 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -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); diff --git a/tests/general/bug-142.out b/tests/general/bug-142.out index 269e7080..9a09b5e4 100644 --- a/tests/general/bug-142.out +++ b/tests/general/bug-142.out @@ -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> diff --git a/tests/general/bug-152.out b/tests/general/bug-152.out index 7bdd3377..3d23ac9e 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 4bf4ca16..697cefba 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 b86f605e..47cc1e7a 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> |