Re: [xml] libxml2 Child Indexing?
- From: Rob Richards <rrichards cdatazone org>
- To: Uzumaki Naruto <narutoreplicate gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] libxml2 Child Indexing?
- Date: Thu, 16 Apr 2009 17:02:56 -0400
Uzumaki Naruto wrote:
Hi all,
I'm using libxml2, and I've been scouring the documentation for a
function to retrieve the handle of a child node that is not either the
first/last (ie: 2nd child / 5).
What I'm looking for is, for example:
rootNode = xmlDocGetRootElement(doc);
secondChildNode = xmlFoo(rootNode , 2);
printf("Node name: %s", secondChildNode->name);
I am currently doing:
rootNode = xmlDocGetRootElement(doc);
firstChildNode = xmlFirstElementChild(rootNode);
secondChildNode = xmlNextElementSibling(nextChildNode);
printf("Node name: %s", secondChildNode->name);
If you dont want to do it manually then you need to use XPath to
retrieve by position.
Rob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]