the NodeComparator class seems to be broken for me. i'm comparing two
documents which are identical in value, yet compare returns 1. i
serialize the two documents to files before the test and verify that
yes, even md5sum agrees they're the same bytes. if the two documents
serialize to the exact same xml document, doesn't that necessarily imply
they compare as equal?
here's a fragment of my code. known_document and unknown_document are
Documents, of course:
OutputFormat outformat = OutputFormat.createPrettyPrint();
outformat.setEncoding("UTF-8");
XMLWriter writer = new XMLWriter(new
FileOutputStream("known.xml"), outformat);
writer.write(known_document);
writer.flush();
writer = new XMLWriter(new FileOutputStream("unknown.xml"),
outformat);
writer.write(unknown_document);
writer.flush();
NodeComparator comparator = new NodeComparator();
assertEquals(0, comparator.compare(known_document,
unknown_document));
any help would be greatly appreciated. i'd rather not have to serialize
the documents to byte arrays to compare them reliably.
- donald
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user