Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isEqual: behaves differently to Apple NSXMLNode/Element #71

Open
chadbag opened this issue Aug 16, 2016 · 1 comment
Open

isEqual: behaves differently to Apple NSXMLNode/Element #71

chadbag opened this issue Aug 16, 2016 · 1 comment

Comments

@chadbag
Copy link

chadbag commented Aug 16, 2016

This should be noted in the documentation or code comments. KissXML "isEqual:" compares class and then object pointer only for the underlying libxml node.

Apple's "isEqual:" says:

"By default NSXMLNode implements the NSObject isEqual: method to perform a deep comparison: two NSXMLNode objects are not considered equal unless they have the same name, same child nodes, same attributes, and so on. The comparison looks at the node and its children, but does not include the node’s parent. If you want a different standard of comparison, override isEqual:."

Things that would be equal under Apple fail under KissXML. I am not asking for it to be changed, but just recommending that it be noted in the code comments are somewhere convenient so that users of KissXML can plan around the difference.

I noted this by creating an XMLString of a node and then creating another node using that XMLString and comparing them with "isEqual:". Creating new XMLString from both show that they are exactly the same.

@chrisballinger
Copy link
Collaborator

Send pull request and I'll merge thanks

On Tue, Aug 16, 2016 at 11:29 AM, chadbag notifications@github.com wrote:

This should be noted in the documentation or code comments. KissXML
"isEqual:" compares class and then object pointer only for the underlying
libxml node.

Apple's "isEqual:" says:

"By default NSXMLNode implements the NSObject isEqual: method to perform a
deep comparison: two NSXMLNode objects are not considered equal unless they
have the same name, same child nodes, same attributes, and so on. The
comparison looks at the node and its children, but does not include the
node’s parent. If you want a different standard of comparison, override
isEqual:."

Things that would be equal under Apple fail under KissXML. I am not asking
for it to be changed, but just recommending that it be noted in the code
comments are somewhere convenient so that users of KissXML can plan around
the difference.

I noted this by creating an XMLString of a node and then creating another
node using that XMLString and comparing them with "isEqual:". Creating new
XMLString from both show that they are exactly the same.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfqH3ZK74w2m_L1ck2DKKuxnmbJlAyZks5qggF2gaJpZM4Jlth4
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants