dev@fi.java.net

Re: JAXB and of base64 data and FI

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 03 Aug 2005 19:11:44 +0200

Kohsuke Kawaguchi wrote:
>> Is the code in the JAXB CVS? maybe it is something better to use than
>> what we currently have for FI.
>
>
> DOM is produced normally. It's a DOM comparator that compares attributes
> by ignoring orders, ignoring comments, ignoring ns decls, etc.
>
> It actually works against JDOM, and it's at
> http://cvsync.red.iplanet.com/cvsweb/vmtools/?cvsroot=WPTS
>
> Originally the project was started elsewhere, but they abandoned the
> maintenance, so I'm maintaining a local copy here.
>
> If you are interested in using it, you are welcome to do so. But I'm not
> particularly happy with it (especially its performance when comparing a
> large tree). It's originally developed as a diff tool, not just an
> equality tester, so that's probably why.
>
> What are you using in FI today?
>

Basically a SAX content handler that writes out the SAX events in a
canonical form:

So for this XML:

<a b="c">text</a>

It would produce:

<sax xmlns="http://www.sun.com/xml/sax-events">
<startDocument/>
<startElement uri="" localName="a" qName="a">
   <attribute qName="b" localName="b" uri="" value="c"/>
</startElement>
<characters>text</characters>
<endElement uri="" localName="a" qName="a"/>
<endDocument/>


It works quite well and has helped with debuging because it is easy to
determine where a problem based on simple textual diffs or when an error
occurs.

For comparing large documents i would have found a DOM based diff tool
easier to navigate than a textual diff tool.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109