From bc1224693669d2c63fcadb295875c3c343712b8f Mon Sep 17 00:00:00 2001 From: jansule Date: Tue, 13 Feb 2024 16:37:31 +0100 Subject: [PATCH] fix: actually set xmlns on filter --- src/SldStyleParser.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SldStyleParser.ts b/src/SldStyleParser.ts index 4dacd16c..3cbb74cd 100644 --- a/src/SldStyleParser.ts +++ b/src/SldStyleParser.ts @@ -1210,8 +1210,12 @@ export class SldStyleParser implements StyleParser { 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' + }; } });