aboutsummaryrefslogtreecommitdiff
path: root/lib/xml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xml')
-rw-r--r--lib/xml/reader.js4
-rw-r--r--lib/xml/writer.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/xml/reader.js b/lib/xml/reader.js
index 6189851..67b69be 100644
--- a/lib/xml/reader.js
+++ b/lib/xml/reader.js
@@ -35,11 +35,11 @@ function readString(xmlString, namespaceMap) {
var mappedPrefix = namespaceMap[node.uri];
var prefix;
if (mappedPrefix) {
- prefix = mappedPrefix;
+ prefix = mappedPrefix + ":";
} else {
prefix = "{" + node.uri + "}";
}
- return prefix + ":" + node.local;
+ return prefix + node.local;
} else {
return node.local;
}
diff --git a/lib/xml/writer.js b/lib/xml/writer.js
index 9bf8c35..0c44982 100644
--- a/lib/xml/writer.js
+++ b/lib/xml/writer.js
@@ -25,7 +25,7 @@ function writeString(root, namespaces) {
}
function mapElementName(name) {
- var longFormMatch = /^\{(.*)\}:(.*)$/.exec(name);
+ var longFormMatch = /^\{(.*)\}(.*)$/.exec(name);
if (longFormMatch) {
var prefix = uriToPrefix[longFormMatch[1]];
return prefix + (prefix === "" ? "" : ":") + longFormMatch[2];