Hi,

I have a question on Xalan C++. I am trying to perform
very basic XML operations like
getting/setting/adding/removing attributes and
elements in a DOM tree. My code needs to use the XPath
passed by the user to perform these operations. I
found that the sample code available on the website is
mostly for more advanced features like XSL stylesheet
and transformation (except for the example
SimpleXPathAPI). Is there any other sample code
available that I can look at?

I could write the function for getting an attribute
value using the XPathEvaluator::evaluate() function.
But while trying to set an attribute value, I am
getting an exception. My code is as follows.

XalanNode* const        theResultNode =
theEvaluator.selectSingleNode(theDOMSupport,
theContextNode, XalanDOMString(buf).c_str(),
thePrefixResolver);
const XalanDOMString    valueXDS(value);
if (theResultNode)
        ((XalanAttr *)&theResultNode)->setValue(valueXDS);

Here setValue is cauing the exception. theResultNode
is supposed to point to the attribute node whose value
is getting set. Can somebody help me with this? Am I
using the right classes and APIs?

Many thanks.

Pinaki

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to