Trans wrote:

On Jul 8, 12:04 pm, Charlie Savage <[EMAIL PROTECTED]> wrote:
Hmmm... How does the C library itself handle comparison?
Well, in C the == is identity (comparing pointer addresses).  libxml
does not provide an equality method that I see.

So there is no way to compare on content, only identity.

Well, its easy enough:

if node1.to_s == node2.to_s

Or

if node1.content == node2.content

to_s is like outerHTML and content is innerHTML (sort of).

But is that
good for Ruby too? I wonder how changing #== to identity might effect
current users?

Best guess it gives them a nice performance boost, since I'm not seeing how comparing on content is useful

Even so, I agree that comparing raw xml strings doesn't
makes sense, but comparing equivalence, as opposed to identity, can be
useful, ie. same tag names, same attributes (irregardless of order)
and same data.

See above.

Otherwise it would seem like we are suggesting that XML
nodes should be immutable.

Hmm, why do you say that?

Charlie

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to