Commit 62040be3 authored by Daniel Veillard's avatar Daniel Veillard

avoid returning default namespace when searching from an attribute reverse

* tree.c: avoid returning default namespace when searching
  from an attribute
* entities.c xmlwriter.c: reverse xmlEncodeSpecialChars() behaviour
  back to escaping " since the normal serialization routines do not
  use it anymore, should close bug #134477 . Tried to make
  the writer avoid it too but it didn't work.
Daniel
parent a98357ad
Sun May 16 23:12:35 CEST 2004 Daniel Veillard <daniel@veillard.com>
* tree.c: avoid returning default namespace when searching
from an attribute
* entities.c xmlwriter.c: reverse xmlEncodeSpecialChars() behaviour
back to escaping " since the normal serialization routines do not
use it anymore, should close bug #134477 . Tried to make
the writer avoid it too but it didn't work.
Sun May 16 01:07:16 CEST 2004 Daniel Veillard <daniel@veillard.com>
* doc/ChangeLog.awk doc/ChangeLog.xsl: fixed escaping
......
......@@ -625,7 +625,6 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
*out++ = 'm';
*out++ = 'p';
*out++ = ';';
#if 0
} else if (*cur == '"') {
*out++ = '&';
*out++ = 'q';
......@@ -633,7 +632,6 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
*out++ = 'o';
*out++ = 't';
*out++ = ';';
#endif
} else if (*cur == '\r') {
*out++ = '&';
*out++ = '#';
......
......@@ -5481,6 +5481,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
{
xmlNsPtr cur;
xmlNodePtr orig = node;
int is_attr;
if ((node == NULL) || (href == NULL))
return (NULL);
......@@ -5524,6 +5525,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
}
return (doc->oldNs);
}
is_attr = (node->type == XML_ATTRIBUTE_NODE);
while (node != NULL) {
if ((node->type == XML_ENTITY_REF_NODE) ||
(node->type == XML_ENTITY_NODE) ||
......@@ -5534,7 +5536,8 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
while (cur != NULL) {
if ((cur->href != NULL) && (href != NULL) &&
(xmlStrEqual(cur->href, href))) {
if (xmlNsInScope(doc, orig, node, cur->href) == 1)
if (((!is_attr) || (cur->prefix != NULL)) &&
(xmlNsInScope(doc, orig, node, cur->href) == 1))
return (cur);
}
cur = cur->next;
......@@ -5544,7 +5547,8 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
if (cur != NULL) {
if ((cur->href != NULL) && (href != NULL) &&
(xmlStrEqual(cur->href, href))) {
if (xmlNsInScope(doc, orig, node, cur->href) == 1)
if (((!is_attr) || (cur->prefix != NULL)) &&
(xmlNsInScope(doc, orig, node, cur->href) == 1))
return (cur);
}
}
......
......@@ -1326,6 +1326,10 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content)
switch (p->state) {
case XML_TEXTWRITER_NAME:
case XML_TEXTWRITER_TEXT:
#if 0
buf = NULL;
xmlOutputBufferWriteEscape(writer->out, content, NULL);
#endif
buf = xmlEncodeSpecialChars(NULL, content);
break;
case XML_TEXTWRITER_ATTRIBUTE:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment