You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm aware this is a dup of issue #194, but the constants in XML::Node are not those returned by Reader#node_type; rather they appear to be the enum values of xmlReaderTypes defined in xmlreader.h.
Example:
Nokogiri::XML::Reader(' ').tap {|rdr|
while rdr.read
p [rdr.name, rdr.depth, rdr.node_type]
end
}
# ["top", 0, 1]
# ["#text", 1, 14]
# ["top", 0, 15]
The whitespace node is type 14 and the close tag is type 15, which match xmlReaderTypes:
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
XML_READER_TYPE_END_ELEMENT = 15,
Compare with XML::Node constants:
Nokogiri::XML::Node.tap {|n| p [n::DTD_NODE, n::ELEMENT_DECL] }
# => [14, 15]
Thanks for looking into this.
The text was updated successfully, but these errors were encountered:
I'm aware this is a dup of issue #194, but the constants in XML::Node are not those returned by Reader#node_type; rather they appear to be the enum values of xmlReaderTypes defined in xmlreader.h.
Example:
Nokogiri::XML::Reader(' ').tap {|rdr|
while rdr.read
p [rdr.name, rdr.depth, rdr.node_type]
end
}
# ["top", 0, 1]
# ["#text", 1, 14]
# ["top", 0, 15]
The whitespace node is type 14 and the close tag is type 15, which match xmlReaderTypes:
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
XML_READER_TYPE_END_ELEMENT = 15,
Compare with XML::Node constants:
Nokogiri::XML::Node.tap {|n| p [n::DTD_NODE, n::ELEMENT_DECL] }
# => [14, 15]
Thanks for looking into this.
The text was updated successfully, but these errors were encountered: