Re: [xml] new tree.c function


I wrote the function that does what xpath should do because xpath didn't seem to work on a xmlDocPtr created with xmlNewDoc(). However, xpath works fine if I create an xmlDocPtr with the xmlParseFile()function.

Any ideas?


Daniel Veillard wrote:
On Thu, May 22, 2008 at 10:12:22AM +0000, dhk wrote:

I am working on a function to find a node in an xml document and thought it would be useful for the tree library. Do you know how I can submit it for review? Right now it only finds an element node, but I intend to expand it to find other node types.

  hum, use the mailing list, send the patch as an unified diff,

The motivation for this function was that when building a tree there didn't seem to be an easy way to find a particular node in the document. In my case I wanted to get an xmlNodePtr to a tag called <SequenceNumber> with specific value. That way I could easily add siblings.

Let me know if you're interested.

  What I don't know is why you're trying to reinvent XPath ?
Soon you will find that - multiple node may match your criteria so what you want is a node set
  - you want to extend your queries
creating a new function each time just doesn't work from an API
perspective. Then you need to define exact semantic ... basically
you will find you need to interpret a query ... i.e. reinventing
the XPath wheel.


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