aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodejs/xmlGenerator.js
diff options
context:
space:
mode:
authorMark Engel <mark.c.engel@gmail.com>2011-01-28 17:04:12 +0100
committerMark Engel <mark.c.engel@gmail.com>2011-01-28 17:04:12 +0100
commit5df2c8b916bf8845042be1f9df4656cd13a3ddbe (patch)
tree8ae6d83cdd87dcdb058c85ce33e566a09752483d /src/nodejs/xmlGenerator.js
parent52531bb1553a7e3a288465a68284192f4fbba18c (diff)
parent243fa3e0193b270deb1614bb0b7e0e8e62afc4ad (diff)
downloadosm-xapi-5df2c8b916bf8845042be1f9df4656cd13a3ddbe.tar.gz
osm-xapi-5df2c8b916bf8845042be1f9df4656cd13a3ddbe.tar.xz
osm-xapi-5df2c8b916bf8845042be1f9df4656cd13a3ddbe.zip
Merge branch 'master' of github.com:slomo/osm-spline-xapi
Diffstat (limited to 'src/nodejs/xmlGenerator.js')
-rw-r--r--src/nodejs/xmlGenerator.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nodejs/xmlGenerator.js b/src/nodejs/xmlGenerator.js
index 258cb18..a477457 100644
--- a/src/nodejs/xmlGenerator.js
+++ b/src/nodejs/xmlGenerator.js
@@ -1,3 +1,5 @@
+var config;
+
var builder = require('xmlbuilder');
//set up logger
var log4js = require('log4js')(); //note the need to call the function
@@ -48,3 +50,17 @@ exports.createWay = function (row) {
return builder.toString({pretty:'true'});
};
+//header for xml response with information about xapi instance...
+exports.createHeader = function createHeader() {
+ var header = "<?xml version='1.0' standalone='no'?>";
+ var tmp = builder.begin('osm')
+ .att('version',this.config.version)
+ .att('generator',this.config.generator)
+ .att('xmlns:xapi',this.config.namespace)
+ .att('xapi:uri','')
+ .att('xapi:planetDate','')
+ .att('xapi:copyright',this.config.copyright)
+ .att('xapi:instance',this.config.instance);
+ header = header + tmp.toString();
+ return header.substr(0,header.length-2) + " >";
+}