Strange results of xpath element search using string-value

Алексей Алексей schrieb am 29.09.2017 um 23:12:
According to how I read the spec, that looks like a bug. """ The string-value of an element node is the concatenation of the string-values of all text node descendants of the element node in document order. """ https://www.w3.org/TR/xpath/#element-nodes However, the XPath implementation is in libxml2, not in lxml. Please report the bug over there. Using xmllint instead of lxml usually helps them: $ echo '<aaa><bbb>f<ccc>e</ccc>d</bbb></aaa>' | \ xmllint --xpath '//bbb[. = "fed"]' - XPath set is empty $ echo '<aaa><bbb>f<ccc>e</ccc>d</bbb></aaa>' | \ xmllint --xpath '//bbb[string() = "fed"]' - <bbb>f<ccc>e</ccc>d</bbb> Stefan

Алексей Алексей schrieb am 29.09.2017 um 23:12:
According to how I read the spec, that looks like a bug. """ The string-value of an element node is the concatenation of the string-values of all text node descendants of the element node in document order. """ https://www.w3.org/TR/xpath/#element-nodes However, the XPath implementation is in libxml2, not in lxml. Please report the bug over there. Using xmllint instead of lxml usually helps them: $ echo '<aaa><bbb>f<ccc>e</ccc>d</bbb></aaa>' | \ xmllint --xpath '//bbb[. = "fed"]' - XPath set is empty $ echo '<aaa><bbb>f<ccc>e</ccc>d</bbb></aaa>' | \ xmllint --xpath '//bbb[string() = "fed"]' - <bbb>f<ccc>e</ccc>d</bbb> Stefan
participants (2)
-
Stefan Behnel
-
Алексей Алексей