Open Igor-Palaguta opened 2 years ago
Expected behaviour: element.firstChild(tag: "text") return first text node instead of element node with tag name "text"
Actual behaviour: returns element not text node
Package Manager: CocoaPods, version: 1.11.2
Fuzi version: 3.1.3
Xcode version: 13.4
<parent> <text>Some text</text> </parent>
parent.firstChild(tag: "text")?.stringValue == " \n" instead of parent.firstChild(tag: "text")?.stringValue == "Some text" parent.firstChild(tag: "text")?.type == .Text instead of parent.firstChild(tag: "text")?.type == .Element
parent.firstChild(tag: "text")?.stringValue == " \n"
parent.firstChild(tag: "text")?.stringValue == "Some text"
parent.firstChild(tag: "text")?.type == .Text
parent.firstChild(tag: "text")?.type == .Element
parent.children(tag: "text") finds proper nodes as it checks also element type
parent.children(tag: "text")
@cezheng please have a look at https://github.com/cezheng/Fuzi/pull/121
Description:
Expected behaviour: element.firstChild(tag: "text") return first text node instead of element node with tag name "text"
Actual behaviour: returns element not text node
Environment
Package Manager: CocoaPods, version: 1.11.2
Fuzi version: 3.1.3
Xcode version: 13.4
How to reproduce:
parent.firstChild(tag: "text")?.stringValue == " \n"
instead ofparent.firstChild(tag: "text")?.stringValue == "Some text"
parent.firstChild(tag: "text")?.type == .Text
instead ofparent.firstChild(tag: "text")?.type == .Element
parent.children(tag: "text")
finds proper nodes as it checks also element type