aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodejs/xmlGenerator.js
diff options
context:
space:
mode:
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) + " >";
+}