diff options
author | Mark Engel <mark.c.engel@gmail.com> | 2011-01-21 19:59:09 +0100 |
---|---|---|
committer | Mark Engel <mark.c.engel@gmail.com> | 2011-01-21 19:59:09 +0100 |
commit | 8f3aaad7210274d49af81b504cb7fc81158e830a (patch) | |
tree | a88193922417d1b1db315c03ba7436b66bedcc74 /src/nodejs/xmlGenerator.js | |
parent | 83967abe326c8c76f71d69ba6fe75f5bbdf6a2c0 (diff) | |
download | osm-xapi-8f3aaad7210274d49af81b504cb7fc81158e830a.tar.gz osm-xapi-8f3aaad7210274d49af81b504cb7fc81158e830a.tar.xz osm-xapi-8f3aaad7210274d49af81b504cb7fc81158e830a.zip |
added opts for command line parsing
Diffstat (limited to 'src/nodejs/xmlGenerator.js')
-rw-r--r-- | src/nodejs/xmlGenerator.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nodejs/xmlGenerator.js b/src/nodejs/xmlGenerator.js index e982e18..5dc0efa 100644 --- a/src/nodejs/xmlGenerator.js +++ b/src/nodejs/xmlGenerator.js @@ -24,7 +24,7 @@ exports.createNode = function (row) { .att('v',escape(temp[x+1])); } return builder.toString({ pretty: true }); -} +}; exports.createWay = function (row) { var way = builder.begin('way') @@ -39,14 +39,12 @@ exports.createWay = function (row) { .att('k',escape(temp[x])) .att('v',escape(temp[x+1])); } - var temp = row.nodes.replace("{","").replace("}","").split(","); - for(var x=0;x<temp.length;x++) { - way.ele('nd') - .att('ref',temp[x]); + for(var i=0;i<temp.length;i++) { + way.ele('nd').att('ref',temp[i]); } return builder.toString({pretty:'true'}); -} +}; function toISO8601(date) { //2007-03-31T00:09:22+01:00 |