[xml] Attributes and Contents


we've been using libxml2 on our project for a while now. for what we have been doing up until now we've only 
need to do xpath expressions with getting the contents after the object. i wanted to add getting attributes 
to our code and hit a question...

right now we call xmlXPathEvalExpression to evaluate a path and then call xmlNodeGetContent to get the 
contents. now when i went to look into adding attributes i figured there would be a xmlNodeGetAttribute or 
similar call and a xmlAttributeGetContents or similar call. however i don't seem to be able to find them. so 
i guess my questions are...

1. is there these functions (or similar) for attributes (and i am just blind)?
2. what is the difference between calling xmlNodeGetContent(node) and just accessing node->contents directly? 
especially if im just going to put it in a std::string?

thank you.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]