corrected compareNodes for the case where the two nodes are from different documents

This commit is contained in:
jez 2008-05-28 15:08:58 +00:00
parent 2e1b775e71
commit 9ba32a5160

View file

@ -138,7 +138,7 @@ int compareNodes(const DOM::Node<string_type, string_adaptor>& lhs,
// different documents
if(get_owner_document(lhs) != get_owner_document(rhs))
return (lhs.getOwnerDocument().underlying_impl() < rhs.getOwnerDocument().underlying_impl()) ? 1 : -1;
return (get_owner_document(lhs).underlying_impl() < get_owner_document(rhs).underlying_impl()) ? 1 : -1;
// ok, nodes belong to the same document, but do they belong to the document itself, or a document fragment,
// or is it just floating free? if they both belong to a document fragment, is it the same fragment?