Re: [xml] Smart way to get ancestors?
- From: Daniel Veillard <veillard redhat com>
- To: Michael Ransburg <michael ransburg itec uni-klu ac at>
- Cc: xml gnome org
- Subject: Re: [xml] Smart way to get ancestors?
- Date: Fri, 7 Jul 2006 16:47:19 -0400
On Fri, Jul 07, 2006 at 09:11:35PM +0200, Michael Ransburg wrote:
Hi!
A small update, this is the way I retrieve the ancestors now:
node = xmlTextReaderExpand(reader);
node->children = NULL;
node->prev = NULL;
node->next = NULL;
while (node->parent != NULL) {
node = node->parent;
}
xmlDocSetRootElement(doc,xmlCopyNode(node->children,1));
This works fine - is it a proper way to accomplish this?
Why are you using the reader (i.e streaming) when it seems you
need full tree informations ?
Modifying a node or document being processed by a reader is not
proper, that should be considered read-only really.
Daniel
--
Daniel Veillard | Red Hat http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]