Skip to content
Snippets Groups Projects
Commit c2a1002a6635 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

fixed #303289 variable in match are forbidden had to fix that test which

* 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
parent 865848df0a2c
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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);
......
<?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>
......
<?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>
......
......@@ -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>
......
<?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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment