fahrplan_download.js: fix

This commit is contained in:
Astro 2010-10-13 18:29:03 +02:00
parent ee0ccaa827
commit 4b5916302c
1 changed files with 6 additions and 4 deletions

View File

@ -33,6 +33,8 @@ function get(path, cb) {
req.on('response', function(res) {
if (res.statusCode === 200)
cb(res);
else
console.warn(res.statusCode + ': ' + path);
});
}
@ -102,12 +104,12 @@ function downloadXml(path, attrMapper) {
p.addListener('xmlDecl', function(version, encoding, standalone) {
f.write('<?xml');
if (version)
f.write(' version="' + version + "'");
f.write(' version="' + version + '"');
if (encoding)
f.write(' encoding="' + encoding + "'");
f.write(' encoding="' + encoding + '"');
if (standalone)
f.write(' standalone="' + standalone + "'");
f.write('?>');
f.write(' standalone="' + (standalone ? 'yes' : 'no') + '"');
f.write("?>\n");
});
res.on('data', function(data) {