The latter works because, if a node-set is passed into functions like string, XPath 1.0 just looks at the first node (in document order) in that node-set, and ignores the rest. To see the multiple text nodes, you can use: //example//text()Īnd to more clearly see the entire text content of an element, one can use the string function: string(//example) refers to the entire text content of the element and it's children. If you want to find text that spans multiple children/text nodes, then you can use. The following expression will return the element: //example To find an element containing specific text, you can use the contains function. Here we can see that the text() node specifier is optional when using normalize-space. Browsers & Mail: Free Windows Text Editor that transposes last 2 characters typed on Co I'm looking for a free Windows Text editor, other than XEmacs, that will transpose the last 2 characters typed when I press Control-t. I've tried uninstalling Chrome and reinstalling, same. Which will trim the surrounding whitespace before doing the comparison. The keyboard shortcut works and so does the Chrome menu. To retrieve both and, one could use: //*
This is because the element contains whitespace surrounding the hello text. Will return the hello element, but not the element.