Skip to content

Commit

Permalink
fix: actually set xmlns on filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jansule committed Feb 13, 2024
1 parent 20d7bdf commit bc12246
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SldStyleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,12 @@ export class SldStyleParser implements StyleParser<string> {
const rules: any[] = this.getSldRulesFromRules(geoStylerStyle.rules);
// add the ogc namespace to the filter element, if a filter is present
rules.forEach(rule => {
if (rule.Filter && !rule.Filter['@_xmlns']) {
rule.Filter['@_xmlns'] = 'http://www.opengis.net/ogc';
const ruleEl = get(rule, this.getTagName('Rule'));
const filter = getChildren(ruleEl, 'Filter').at(0);
if (filter) {
filter[':@'] = {
'@_xmlns': 'http://www.opengis.net/ogc'
};
}
});

Expand Down

0 comments on commit bc12246

Please sign in to comment.