diff options
author | booo <borgers@mi.fu-berlin.de> | 2011-01-28 16:08:59 +0100 |
---|---|---|
committer | booo <borgers@mi.fu-berlin.de> | 2011-01-28 16:08:59 +0100 |
commit | e248fe5f83e6e6c62cf66281937014ce23558b2f (patch) | |
tree | a5a621f1329052398d53ace4ee9e3fd0132a4ad6 /src/nodejs/xmlGenerator.js | |
parent | 30fb6b81a2eb73f78fb621079a2e4332fd53a31f (diff) | |
download | osm-xapi-e248fe5f83e6e6c62cf66281937014ce23558b2f.tar.gz osm-xapi-e248fe5f83e6e6c62cf66281937014ce23558b2f.tar.xz osm-xapi-e248fe5f83e6e6c62cf66281937014ce23558b2f.zip |
xml header
Diffstat (limited to 'src/nodejs/xmlGenerator.js')
-rw-r--r-- | src/nodejs/xmlGenerator.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nodejs/xmlGenerator.js b/src/nodejs/xmlGenerator.js index 258cb18..91837d1 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',config.version) + .att('generator',config.generator) + .att('xmlns:xapi',config.namespace) + .att('xapi:uri','') + .att('xapi:planetDate','') + .att('xapi:copyright',config.copyright) + .att('xapi:instance',config.instance); + header = header + tmp.toString(); + return header.substr(0,header.length-2) + " >"; +} |