avoid unneeded whitespace in style XML output

This commit is contained in:
Dane Springmeyer 2013-01-23 16:57:27 -08:00
parent 16f60edc50
commit 3f70b8a36c
5 changed files with 8 additions and 8 deletions

View File

@ -28,19 +28,19 @@ tree.StyleXML = function(name, attachment, definitions, env) {
if (image_filters.length) {
attrs_xml += ' image-filters="' + image_filters.map(function(f) {
return f.ev(env).toXML(env, true, ',', 'image-filter');
}).join(',') + '" ';
}).join(',') + '"';
}
if (comp_op.length) {
attrs_xml += ' comp-op="' + comp_op[0].value.ev(env).toString() + '" ';
attrs_xml += ' comp-op="' + comp_op[0].value.ev(env).toString() + '"';
}
if (opacity.length) {
attrs_xml += ' opacity="' + opacity[0].value.ev(env).toString() + '" ';
attrs_xml += ' opacity="' + opacity[0].value.ev(env).toString() + '"';
}
var rule_string = rules.join('');
if (!attrs_xml && !rule_string) return '';
return '<Style name="' + name + '" filter-mode="first" ' + attrs_xml + '>\n' + rule_string + '</Style>';
return '<Style name="' + name + '" filter-mode="first"' + attrs_xml + '>\n' + rule_string + '</Style>';
};
})(require('../tree'));

View File

@ -1,4 +1,4 @@
<Style name="style-power" filter-mode="first" >
<Style name="style-power" filter-mode="first">
<Rule>
<Filter>([power] = 'generator') and ([generator:source] = 'wind')</Filter>
<MarkersSymbolizer width="0" />

View File

@ -1,2 +1,2 @@
<Style name="style" filter-mode="first" opacity="0.5" >
<Style name="style" filter-mode="first" opacity="0.5">
</Style>

View File

@ -1,2 +1,2 @@
<Style name="style" filter-mode="first" comp-op="color-burn" >
<Style name="style" filter-mode="first" comp-op="color-burn">
</Style>

View File

@ -1,2 +1,2 @@
<Style name="style" filter-mode="first" image-filters="invert" >
<Style name="style" filter-mode="first" image-filters="invert">
</Style>