Re: [xml] Exchanging same XML fragment in multiple XML documents



Hi Daniel!

Thanks for your quick reply!

On Wed, 6 Nov 2002, Daniel Veillard wrote:

[...] 
  The first thing to do when you have such a question is to lookup
the definition of xmlXPathObjectPtr, isn't it ?

Right, that's what I did.

  isn't that obvious ?
  object->nodesetval
of course you need first to check the type,
then to get to the node(s) assuming the nodesetval ain't NULL:

I thought of doing that (I mentioned nodesetval in my last mail indicating that 
I indeed *did* look it up), but was not sure since I had
the impression that accessing nodesetval and nodeTab directly is not
clean; I thought there was some function to access it. Well, obviously I
was wrong... Thanks a lot for clarifying this.

  copy it in each document using xmlDocCopyNode()

Using this function assumes that I already have an
xmlNodePtr. However, this is not the case when having a textual
representation of an XML fragment. My question thus is: How do I convert a
textual representation of an XML fragment to a node list (xmlNodePtr)?
 
  one operates on a single node subtree, and the other does the same on the
full list 

Ok, this wasn't clear to me since the documentation for these two
functions only differs in one word: "tree" in one, and "list" in the
other. That's the reason why I was confused. One can not possibly figure
out the difference between the two from just one sentence, and even when
looking at the code, one is easily tempted to believe that these two are
similar, while in fact they aren't.

Thanks for your info!

Kind regards,

        Holger





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