Re: [xml] xmlNodeListGetString question

[Daniel Veillard (Re: [xml] xmlNodeListGetString question) writes:]

  xmlChar *
  xmlNodeGetContent(xmlNodePtr cur)

That picked out the words from the <foreign/> OK, but didn't get the English
words around it. If there is no embedded <foreign/> it's fine.

As I see it I have to loop somehow, but I can't see the process for doing

The manual says of xmlNodeGetContent(): "Read the value of a node, this can
be either the text carried directly by this node if it's a TEXT node or the
aggregate string of the values carried by this node child's (TEXT and
ENTITY_REF). Entity references are substituted."

What I need is BOTH the text carried directly by this node and the values
carried by this node's child.

<term lang="en">Some English words <foreign lang="sa">some Sanscrit words
</foreign> some more English words</term>

Any suggestions?


Jim Breen  (j breen csse monash edu au
Computer Science & Software Engineering,                Tel: +61 3 9905 3298
P.O Box 26, Monash University,                          Fax: +61 3 9905 5146
Clayton VIC 3800, Australia      ジム・ブリーン モナシュ大学

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