I don't code with Xerces C++ but it seems to implement the W3C DOM Level 3 so based on that I would suggest to select an element node with a path like /abc/def
and then simply to access result->getNodeValue()->getTextContent()
to get the contents of the element (e.g. AAA BBB CCC
).
As far as I understand the DOM APIs, if you want a string value then you need to use a path like string(/abc/def)
and then result->getStringValue()
should do (if the evaluate
method requests any type or STRING_TYPE as the result type).
Other approaches if you know you are only interested in the first node in document order you could evaluate /abc/def
with FIRST_ORDERED_NODE_TYPE
and then access result->getNodeValue()->getTextContent()
.