Re: [xml] xmlNodeListGetString question

[Cameron McCormack (Re: [xml] xmlNodeListGetString question) writes:]
Jim Breen:
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

Does using xmlXPathCastNodeToString work?  I'm guessing that's the way
an xsl:value-of, to convert a node to a string, is achieved in XSL.

Yes, that picks up the lot. Many thanks.

One oddity - the string it returns appears to wrapped in some extra
characters. I haven't examined them too closely, but it looks as though it
has a \n and several spaces at the front, and some spaces followed by another
\n at the back. This appears only to happen when there is a child embedded in
the text.

I can probably/possibly trim these out, but it would be better to avoid them


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]