Reputation: 25611
Please consider this file: http://www.w3schools.com/dom/books.xml where line:
<book category="children">
is replaced with:
<book category=" children ">
Executing xpath query in vbscript for category
attribute value:
For Each n In objXML.selectNodes("//book/@category")
WScript.Echo n.text
Next
returns result where leading and trailing spaces are removed:
children
This doesn't happen with any other xpath evaluator I have tried.
So is it possible MS to return attribute value as it is, without removing spaces?
Upvotes: 0
Views: 390
Reputation: 16950
It's possible through value
property instead text
.
You'd like to know the differences between those two properties.
Please read the reference, especially Remarks sections.
value Property
text Property
As you can see, in this case main differences between value
and text
is that text normalizes, value doesn't.
For Each n In objXML.selectNodes("//book/@category")
WScript.Echo n.text
WScript.Echo n.value
Next
Upvotes: 1