Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #11452
| 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 | 2012-01-17 21:29 -0800 |
| Organization | http://groups.google.com |
| 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> |
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 | Next — Previous in thread | Find similar | Unroll 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