summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-03-20 10:36:27 +0900
committerDaiki Ueno <ueno@gnu.org>2015-03-20 10:36:44 +0900
commitbf97aa79451a316f221fe752b2b1eedeef4d4453 (patch)
tree08696319d1c819534f2f320f39c192a27c62570c
parent341fbe2d99b6f3e2bf5a04a585c8a4025ad58b4f (diff)
downloadexternal_gettext-bf97aa79451a316f221fe752b2b1eedeef4d4453.zip
external_gettext-bf97aa79451a316f221fe752b2b1eedeef4d4453.tar.gz
external_gettext-bf97aa79451a316f221fe752b2b1eedeef4d4453.tar.bz2
kde-kuit: Use xmlns to avoid element name conflict
* format-kde-kuit.c (XML_NS): New macro. (format_parse): Add namespace qualifier to the <kuit> tag.
-rw-r--r--gettext-tools/src/ChangeLog6
-rw-r--r--gettext-tools/src/format-kde-kuit.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index 11ca073..a8e070e 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-20 Daiki Ueno <ueno@gnu.org>
+
+ kde-kuit: Use xmlns to avoid element name conflict
+ * format-kde-kuit.c (XML_NS): New macro.
+ (format_parse): Add namespace qualifier to the <kuit> tag.
+
2015-03-12 Daiki Ueno <ueno@gnu.org>
* format-kde-kuit.c (format_parse): Remove dead assignment,
diff --git a/gettext-tools/src/format-kde-kuit.c b/gettext-tools/src/format-kde-kuit.c
index 7c6992b..3e00697 100644
--- a/gettext-tools/src/format-kde-kuit.c
+++ b/gettext-tools/src/format-kde-kuit.c
@@ -50,6 +50,8 @@ struct spec
#if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT
+#define XML_NS "https://www.gnu.org/s/gettext/kde"
+
/* Callback called when <element> is seen. */
static void
start_element_handler (void *data, const char *name,
@@ -209,11 +211,14 @@ format_parse (const char *format, bool translated, char *fdi,
str = amp + 1;
}
- buffer = xmalloc (amp_count * 4 + strlen (format) + 16);
+ buffer = xmalloc (amp_count * 4
+ + strlen (format)
+ + strlen ("<gt:kuit xmlns:gt=\"" XML_NS "\"></gt:kuit>")
+ + 1);
*buffer = '\0';
bp = buffer;
- bp = stpcpy (bp, "<kuit>");
+ bp = stpcpy (bp, "<gt:kuit xmlns:gt=\"" XML_NS "\">");
str = format;
while (str < str_limit)
{
@@ -226,7 +231,7 @@ format_parse (const char *format, bool translated, char *fdi,
bp = stpcpy (bp, is_reference (amp) ? "&" : "&amp;");
str = amp + 1;
}
- stpcpy (bp, "</kuit>");
+ stpcpy (bp, "</gt:kuit>");
parser = XML_ParserCreate (NULL);
if (parser == NULL)