38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
|
|
||
|
Author: jorton
|
||
|
Date: Mon Mar 26 14:19:44 2007
|
||
|
New Revision: 522630
|
||
|
|
||
|
URL: http://svn.apache.org/viewvc?view=rev&rev=522630
|
||
|
Log:
|
||
|
* xml/apr_xml.c (elem_size, write_elem): Fix attribute namespace
|
||
|
handling; where applicable, use the mapped namespace index.
|
||
|
|
||
|
PR: 41908
|
||
|
|
||
|
--- apr-util-1.2.8/xml/apr_xml.c.xmlns
|
||
|
+++ apr-util-1.2.8/xml/apr_xml.c
|
||
|
@@ -666,7 +666,8 @@
|
||
|
}
|
||
|
else {
|
||
|
/* compute size of: ' ns%d:%s="%s"' */
|
||
|
- size += 3 + APR_XML_NS_LEN(attr->ns) + 1 + strlen(attr->name) + 2 + strlen(attr->value) + 1;
|
||
|
+ int ns = ns_map ? ns_map[attr->ns] : attr->ns;
|
||
|
+ size += 3 + APR_XML_NS_LEN(ns) + 1 + strlen(attr->name) + 2 + strlen(attr->value) + 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@@ -736,8 +737,10 @@
|
||
|
for (attr = elem->attr; attr; attr = attr->next) {
|
||
|
if (attr->ns == APR_XML_NS_NONE)
|
||
|
len = sprintf(s, " %s=\"%s\"", attr->name, attr->value);
|
||
|
- else
|
||
|
- len = sprintf(s, " ns%d:%s=\"%s\"", attr->ns, attr->name, attr->value);
|
||
|
+ else {
|
||
|
+ ns = ns_map ? ns_map[attr->ns] : attr->ns;
|
||
|
+ len = sprintf(s, " ns%d:%s=\"%s\"", ns, attr->name, attr->value);
|
||
|
+ }
|
||
|
s += len;
|
||
|
}
|
||
|
|