Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11452

Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment

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 <mausamhere@gmail.com>
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> (permalink)
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

Show key headers only | View raw


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.
<Employee company="example" xmlns="http://example.com" debug="true">
        <Employeename>mausam</Employeename>
        <email>a @example.com</email>
        <street/>
    </Employee>

<Employee  debug="true" company="example" xmlns="http://example.com">
        <Employeename>mausam</Employeename>
        <email>a @example.com</email>
    </Employee>

2)
Check the sequence of street element. In Node 1 it is after email and in node2 it is before.
<Employee company="example" xmlns="http://example.com" debug="true">
        <Employeename>mausam</Employeename>
        <email>a @example.com</email>
        <street>Marienplatz</street>
    </Employee>

<Employee  debug="true" company="example" xmlns="http://example.com">
        <Employeename>mausam</Employeename>
        <street>Marienplatz</street>
        <email>a @example.com</email>
    </Employee>

--

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.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Mausam <mausamhere@gmail.com> - 2012-01-17 07:03 -0800
  Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Jeff Higgins <jeff@invalid.invalid> - 2012-01-17 12:32 -0500
    Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Mausam <mausamhere@gmail.com> - 2012-01-17 17:56 -0800
      Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Jeff Higgins <jeff@invalid.invalid> - 2012-01-17 21:33 -0500
        Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Arne Vajhøj <arne@vajhoej.dk> - 2012-01-17 21:56 -0500
  Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Arne Vajhøj <arne@vajhoej.dk> - 2012-01-17 18:38 -0500
    Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Arne Vajhøj <arne@vajhoej.dk> - 2012-01-17 21:55 -0500
      Re: what is the bettter/performant way to compare org.w3c.dom.DocumentFragment Mausam <mausamhere@gmail.com> - 2012-01-17 21:29 -0800

csiph-web