Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit 4aec894

Browse files
committed
Switches from single to double quotes in json2xml script due to crappy commercial software. Closes #11
1 parent c2e83bd commit 4aec894

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/json2xml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function toXml(json, xml) {
2626
xml += obj[key];
2727
} else {
2828
xml = xml.replace(/>$/, '');
29-
xml += ' ' + key + "='" + obj[key] + "'>";
29+
xml += ' ' + key + '="' + obj[key] + '">';
3030
}
3131
}
3232
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"description" : "Converts xml to json and viceverza, using node-expat.",
66
"repository": "git://github.com/buglabs/node-xml2json.git",
77
"main": "index",
8-
"contributors":[ {"name": "Camilo Aguilar", "email": "camilo@buglabs.net"}],
8+
"contributors":[
9+
{"name": "Camilo Aguilar", "email": "camilo@buglabs.net"}
10+
],
911
"dependencies": {
1012
"node-expat": ">=1.4.1 <2.0.0"
1113
}

test/fixtures/domain.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<domain type='qemu'><name>QEmu-fedora-i686</name><uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1809</uuid><memory>219200</memory><currentMemory>219200</currentMemory><vcpu>2</vcpu><os><type arch='i686' machine='pc'>hvm</type><boot dev='cdrom'></boot></os><devices><emulator>/usr/bin/qemu-system-x86_64</emulator><disk type='file' device='cdrom'><source file='/home/user/boot.iso'></source><target dev='hdc'></target><readonly></readonly></disk><disk type='file' device='disk'><source file='/home/user/fedora.img'></source><target dev='hda'></target></disk><interface type='network'><source network='default'></source></interface><graphics type='vnc' port='-1'></graphics></devices><ah type='rare' foo='bar'>cosa1</ah><ah type='normal'>cosa2</ah><ah>cosa3</ah></domain>
1+
<domain type="qemu"><name>QEmu-fedora-i686</name><uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1809</uuid><memory>219200</memory><currentMemory>219200</currentMemory><vcpu>2</vcpu><os><type arch="i686" machine="pc">hvm</type><boot dev="cdrom"></boot></os><devices><emulator>/usr/bin/qemu-system-x86_64</emulator><disk type="file" device="cdrom"><source file="/home/user/boot.iso"></source><target dev="hdc"></target><readonly></readonly></disk><disk type="file" device="disk"><source file="/home/user/fedora.img"></source><target dev="hda"></target></disk><interface type="network"><source network="default"></source></interface><graphics type="vnc" port="-1"></graphics></devices><ah type="rare" foo="bar">cosa1</ah><ah type="normal">cosa2</ah><ah>cosa3</ah></domain>

0 commit comments

Comments
 (0)