Re: [xml] entity conversion


<Company>  AT&amp;T </Company>

i parse this using

doc = LibXML::XML::Document.file('foo.xml')

if node points to this element, then
node.content == 'AT&T'

all well and good. if i want to now create a new document,
then i do

newnode ='Company')
newnode.content = node.content

and this assignment has the error 'unterminated entity reference'
(which could be fair given that it is literally an unterminated entity reference).
the question is should assignment of content automatically do teh conversion
or should teh user be responsible?

On Aug 19, 2009, at 12:54 PM, Michael Ludwig wrote:

Andrew Hume schrieb:
by default, it appears that '&amp;' gets convert to '&' when reading
strings in, but when assigning content to a node, teh same '&' gets an
'unterminated entity reference'.

What's that?

i am using the ruby binding; my intuition is that the problem lies in
the binding, but i thought i'd ask here first.

Could you supply a minimal, runnable test case to illustrate the

Michael Ludwig
xml mailing list, project page

Andrew Hume  (best -> Telework) +1 732-886-1886
andrew research att com  (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA

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