Re: [xml] Obtaining Content of a Node problem


From: Ahmad Jalil Qarshi [mailto:ahmad jalil qarshi gmail com]
Sent: Tuesday, June 12, 2007 10:17 AM
To: xml gnome org
Subject: [xml] Obtaining Content of a Node problem
I am using LibXML2 library in code to parse the XML document. My XML document look like below:

I have to get the content of <Action> Node i.e "Create" in this case. I am doing like below:

xmlNodePtr ActNode = root_node->children->children->children;

ActNode displays "name" as "Action", but "content" parameter is empty.
Kindly help me to resolve this problem.

Thanks in anticipation.


Ahmad Jalil Qarshi  
You might also think about using XPath to fetch the nodes you are interested in:
xmlXPathNewContext (..)
xmlXPathEvalExpression (..)
... also xmlNodeIsText (..) should be your friend 

 best regards / mit freundlichen Grüßen,
Martin Trappel


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