Not the same thing. Comparing raw XML string is overly strict. For
example I would expect the following two snips to be "equal":
Hi
Hi
These would not be equal by string comparison b/c the attribute bar
and baz are not in the same order (to say nothing of white space).
Actuall
On Jul 8, 2:37 pm, Charlie Savage <[EMAIL PROTECTED]> wrote:
> 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 pr
Actually, how about this (pseudo):
def ==(arg)
if arg.kind_of? XML::Node
return true if self.id == arg.id
else
return true if self.to_s == arg
end
end
Deal - I'll do that.
Charlie
smime.p7s
Description: S/MIME Cryptographic Signature
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 nod
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,
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 ide
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.
Charlie
smime.p7s
Description: S/MIME Cryptographic Signature
___
libxm
On Jul 7, 11:20 pm, Charlie Savage <[EMAIL PROTECTED]> wrote:
> Dan Janowski wrote:
> > I think this is a vestige of the old fact that there could be two ruby
> > objects that referred to the same XML node. Since I removed that and now
> > there is only a one-to-one relationship between the ruby
Dan Janowski wrote:
I think this is a vestige of the old fact that there could be two ruby
objects that referred to the same XML node. Since I removed that and now
there is only a one-to-one relationship between the ruby peer and the
XML node, if == is equivalent to equal? and equal? is objec
I think this is a vestige of the old fact that there could be two ruby
objects that referred to the same XML node. Since I removed that and
now there is only a one-to-one relationship between the ruby peer and
the XML node, if == is equivalent to equal? and equal? is object
identity, then i
10 matches
Mail list logo