Re: [xml] XPath on a subtree

2013-04-01 Thread Daniel Veillard
On Sun, Mar 31, 2013 at 06:44:44PM +0800, Daniel Veillard wrote: On Sat, Mar 30, 2013 at 07:11:35PM +, Alex Bligh wrote: BTW the xml is generated so that should be discarded from the patch, That's strange. It appears in git and has a history.

Re: [xml] XPath on a subtree

2013-04-01 Thread Alex Bligh
On 1 Apr 2013, at 09:45, Daniel Veillard wrote: I commited the result: Thanks. -- Alex Bligh ___ xml mailing list, project page http://xmlsoft.org/ xml@gnome.org https://mail.gnome.org/mailman/listinfo/xml

Re: [xml] XPath on a subtree

2013-04-01 Thread Daniel Veillard
On Sun, Mar 31, 2013 at 07:47:34PM +0300, Roumen Petrov wrote: Daniel Veillard wrote: [...] Those are non-standard practices of libxml2 development and I reused them into libxslt and libvirt :-) Ok but for instance NEWS file is one of autogenerated documentation that is not updated .

Re: [xml] XPath on a subtree

2013-04-01 Thread Daniel Veillard
On Sun, Mar 31, 2013 at 07:47:34PM +0300, Roumen Petrov wrote: [...] I think that recent python updates require at least 2.7+ or 3.1+ (Capsule object). Fixed that too in git, https://git.gnome.org/browse/libxml2/commit/?id=bf4a8f0ea8579f05eea2e6f43df73b2a239d41b3 code seems to compile and

Re: [xml] XPath on a subtree

2013-03-31 Thread Daniel Veillard
On Sat, Mar 30, 2013 at 07:11:35PM +, Alex Bligh wrote: BTW the xml is generated so that should be discarded from the patch, That's strange. It appears in git and has a history. https://git.gnome.org/browse/libxml2/tree/doc/libxml2-api.xml How does one regenerate it (as the normal

Re: [xml] XPath on a subtree

2013-03-31 Thread Roumen Petrov
Daniel Veillard wrote: On Sat, Mar 30, 2013 at 07:11:35PM +, Alex Bligh wrote: BTW the xml is generated so that should be discarded from the patch, That's strange. It appears in git and has a history. https://git.gnome.org/browse/libxml2/tree/doc/libxml2-api.xml How does one regenerate

Re: [xml] XPath on a subtree

2013-03-30 Thread Daniel Veillard
On Sat, Mar 23, 2013 at 05:24:11PM +, Alex Bligh wrote: On 23 Mar 2013, at 14:23, Daniel Veillard wrote: Do you mind doing a patch ? :-) Done. Please ignore the two bogus ones with the function name duplicated in the commit message. I blame insufficient caffeine. BTW I'm not

Re: [xml] XPath on a subtree

2013-03-30 Thread Alex Bligh
Daniel, On 30 Mar 2013, at 15:37, Daniel Veillard wrote: BTW I'm not forgetting you, thanks a lot for the patches, but i have been busy porting to Python3, I will look soon ! No problem. BTW the xml is generated so that should be discarded from the patch, That's strange. It appears in

Re: [xml] XPath on a subtree

2013-03-23 Thread Daniel Veillard
On Sat, Mar 23, 2013 at 10:50:15AM +, Alex Bligh wrote: I quite often need to find a set of nodes using an XPath expression, then for each node in that set, do something, then search for zero or more children of that node. What I'm interested in is whether the second search can be done

Re: [xml] XPath on a subtree

2013-03-23 Thread Alex Bligh
Daniel, On 23 Mar 2013, at 11:52, Daniel Veillard wrote: ctxt-node = node; res = xmlXPathEval(./foo.., ctxt); ... of course the subtree query will have to be relative, i.e. not starting by / Ah! The point I'd missed is that you can set ctxt-node. I couldn't see an API call to set

Re: [xml] XPath on a subtree

2013-03-23 Thread Daniel Veillard
On Sat, Mar 23, 2013 at 12:09:25PM +, Alex Bligh wrote: Daniel, On 23 Mar 2013, at 11:52, Daniel Veillard wrote: ctxt-node = node; actually it's good to set the doc too at that point before reusing the context in the loop. ctxt-doc = doc; res = xmlXPathEval(./foo..,

Re: [xml] XPath on a subtree

2013-03-23 Thread Alex Bligh
On 23 Mar 2013, at 13:54, Daniel Veillard wrote: I though I had added a macro but searched for it an no it's not there. In the python bindings there is an extra function called libxml2mod.xmlXPathSetContextNode() That was what I was thinking of, but ... xmlXPathObjectPtr

Re: [xml] XPath on a subtree

2013-03-23 Thread Daniel Veillard
On Sat, Mar 23, 2013 at 02:10:42PM +, Alex Bligh wrote: On 23 Mar 2013, at 13:54, Daniel Veillard wrote: I though I had added a macro but searched for it an no it's not there. In the python bindings there is an extra function called libxml2mod.xmlXPathSetContextNode() That

Re: [xml] XPath on a subtree

2013-03-23 Thread Alex Bligh
On 23 Mar 2013, at 14:23, Daniel Veillard wrote: Do you mind doing a patch ? :-) Done. Please ignore the two bogus ones with the function name duplicated in the commit message. I blame insufficient caffeine. -- Alex Bligh ___ xml mailing list,