well, its up to teh API designer of course,
but i find the asymmetry of teh interface odd.
nevertheless, if it is our duty to encode before assigning,
what routine do we use?
On Aug 28, 2009, at 12:45 PM, Sean Chittenden wrote:
node.content returns a string, which is 'AT&T' iirc, you want to
assign a node, not the content of a node. I believe it's quite
deliberate that it doesn't escape string input (try and construct
an HTML or RSS feed). It's easier to escape on assign than have a
magic escape in these situations, not in these situations, type of
semantics.
Am punting on the rest for someone else to pick up. -sc
On Aug 28, 2009, at 4:53 AM, Andrew Hume wrote:
xml:
<Company> AT&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 = LibXML::XML::Node.new('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?
and if so, is there a convenient method for doing so?
(meta-question: is this documented anywhere, and if so, where?)
------------------
Andrew Hume (best -> Telework) +1 732-886-1886
and...@research.att.com (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel
--
Sean Chittenden
s...@chittenden.org
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel
------------------
Andrew Hume (best -> Telework) +1 732-886-1886
and...@research.att.com (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel