I have this sort of tags in an XML:
<command name="config">config show</command>
For example, to read that one with xpath I do:
//command[@name='config']
but this outs two strings: "config" and "show". I would like to be able to get a unique string: "config show".
I tried /text() and /node() but didn't work. Any idea?
For
this XPath,
selects all
commandelements in the document with a@nameattribute value equal to'config'; in this case, only the element shown above:Should this element be evaluated in the context that automatically converts to a string, or should you force such a conversion via the
string()function,it will be converted to the string value of that element,
which is a single string, not two.