ramachandran_a...@emc.com wrote:
Hi,
I'm using xerces-C++ [version-2.7.0] and xalan-c++ [version-1.10.0] in
my application.
AIM: Open an xml, query the xpath expression to get the nodes and
change the values provided by user in a seperate structure in the
nodes evaluated from the xpath query. I could get the xml node related
to the xpath expression in a XObjectPtr. I can see samples how to read
the data to display from this xpath evaluation. But I'm not sure about
how to manipulate the data and put it back into the original xml.
XPath does not have any "write" semantics, so you cannot use XPath to do
this. You might consider using an XQuery implementation like Xqilla on
top of the Xerces-C DOM.
Another choice is to express the modifications as an XSLT stylesheet
that you generate using the XPath expressions. That could become very
complicated, unless you want to limit the complexity of the XPath
expressions you allow.
A third choice is to use the Xerces-C DOM, and Xalan-C's wrapper around
it to find nodes in the Xerces-C DOM using XPath expressions. You can
then modify the underlying DOM as appropriate.
All of these choices have pluses and minuses. Because your initial
problem description is very vague, it's difficult to say what would be
the best choice.
Dave