Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Mausam Newsgroups: comp.lang.java.programmer Subject: Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Date: Tue, 17 Jan 2012 21:29:45 -0800 (PST) Organization: http://groups.google.com Lines: 36 Message-ID: <17325668.425.1326864585936.JavaMail.geo-discussion-forums@yqih6> References: <16090858.1983.1326812606093.JavaMail.geo-discussion-forums@prig11> <4f160666$0$289$14726298@news.sunsite.dk> <4f1634ad$0$287$14726298@news.sunsite.dk> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 196.15.16.101 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1326864980 6301 127.0.0.1 (18 Jan 2012 05:36:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Jan 2012 05:36:20 +0000 (UTC) In-Reply-To: <4f1634ad$0$287$14726298@news.sunsite.dk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=196.15.16.101; posting-account=BE4JzgoAAACLX-aQYawit5MkTNnptKNs User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11452 Thanks Arne, I can achieve that using Node.isEqualTo(Node) API post JDK1.5. I am worried of following usecases (wondering if its even valid usecase or not) 1) Are these two Nodes equal? (check that one has empty street element and other has no street element. That implies that value for street is empty in both cases. So as per employee object is considered in Java, both will be equal. mausam a @example.com mausam a @example.com 2) Check the sequence of street element. In Node 1 it is after email and in node2 it is before. mausam a @example.com Marienplatz mausam Marienplatz a @example.com -- Please note that I can not create java objects from XMLs as those are free xml fragments and does not comply to schema. But thanks a lot for your effort and code example.