Thursday 15 September 2011

xml - What does '@comment()' do in XPath? -


I am working on an XPath parser, with a grammar as a reference, I was surprised that a With @ symbol KindTest is possible. KindTest can be node () , comment () , text () , or processing- Instructions (xyz) (they test for).

My question is that when someone is mixed with the @ sign; . @ Processing-Instruction ("Expose") , @comment () , @node , and @text What to do? Are they looking for features with processing instructions or comments?

@comment () is a valid XPath location path step expression No return is guaranteed technically it is asking for all comment nodes together with the attribute axis (and you will never find).

I tell my students that / .. is a more compact and readable way to write a complete path, which is not guaranteed to be returned. Technically this is asking for the parent of the root node.

No comments:

Post a Comment