diff --git a/Fuzi.xcodeproj/project.pbxproj b/Fuzi.xcodeproj/project.pbxproj index c2dcf34..a50e063 100644 --- a/Fuzi.xcodeproj/project.pbxproj +++ b/Fuzi.xcodeproj/project.pbxproj @@ -109,7 +109,9 @@ 7913918B1B53B09F00BC07C3 /* Tests */, 7913917E1B53B09F00BC07C3 /* Products */, ); + indentWidth = 2; sourceTree = ""; + tabWidth = 2; }; 7913917E1B53B09F00BC07C3 /* Products */ = { isa = PBXGroup; diff --git a/Sources/Element.swift b/Sources/Element.swift index f42bada..e7858ee 100644 --- a/Sources/Element.swift +++ b/Sources/Element.swift @@ -112,7 +112,7 @@ open class XMLElement: XMLNode { open func firstChild(tag: XMLCharsComparable, inNamespace ns: XMLCharsComparable? = nil) -> XMLElement? { var nodePtr = cNode.pointee.children while let cNode = nodePtr { - if cXMLNode(nodePtr, matchesTag: tag, inNamespace: ns) { + if cNode.pointee.type == XML_ELEMENT_NODE && cXMLNode(nodePtr, matchesTag: tag, inNamespace: ns) { return XMLElement(cNode: cNode, document: self.document) } nodePtr = cNode.pointee.next