                 // do nothing - it was parsed on first iteration
                 return .none
             default:
-                result = try parseElement(node, groupStyle: groupStyle)
-            }
-
-            if let result = result, let filterString = element.allAttributes["filter"]?.text ?? groupStyle["filter"], let filterId = parseIdFromUrl(filterString), let effect = defEffects[filterId] {
+                result = try parseElement(node, style: style)
+            }
+
+            if let result = result, let filterString = style["filter"], let filterId = parseIdFromUrl(filterString), let effect = defEffects[filterId] {
                 result.effect = effect
             }
         }

                                    "fill", "fill-rule", "fill-opacity", "clip-path", "mask",
                                    "opacity", "color", "stop-color", "stop-opacity",
                                    "font-family", "font-size", "font-weight", "text-anchor",
                                    "visibility"]

    fileprivate let xmlString: String
    fileprivate let initialPosition: Transform

    fileprivate func parseNode(_ node: XMLIndexer, groupStyle: [String: String] = [:]) throws -> Node? {
        var result: Node?
        if let element = node.element {
            let style = getStyleAttributes(groupStyle, element: element)
            if style["display"] == "none" {
                return .none
            }
            switch element.name {
            case "g":
                result = try parseGroup(node, style: style)
            case "clipPath":
                if let id = element.allAttributes["id"]?.text, let clip = try parseClip(node) {
                    self.defClip[id] = clip
