dev@fi.java.net

Re: Samples need updating

From: Joe Wang <joe.wang_at_sun.com>
Date: Mon, 28 Feb 2005 16:57:44 -0800

Paul Sandoz wrote:

> Hi Joe,
>
> Can you update the samples:
>
> - We need to be clearer on the naming of classes, please rename
> classes to be clearer on their function.

What would be good names for these samples?
    Current Rename
samples.sax.FIParser package name already indicates it's a SAX
sample, so how about ParseFIDoc
                                       for the function is to
demonstrate how to use FI SAX Parser to parse a FI doc.
samples.sax.FISerializer XMLtoFISerializing
samples.sax.XMLToFI remove

samples.stax.DocumentSerializer XMLtoFISerializing (same, but use StAX)
samples.stax.EventReader EventParse (as in zephyr)
samples.stax.StreamReader CursorParse (as in zephyr)

Please let me know.

>
> - We can have a dom package for use of the DOMDocumentSerializer and
> DOMDocumentParser.

Will do.

>
> - We need SAX and DOM parsing examples.

For SAX, we have samples.sax.FIParser currently. For DOM, it would be
what's mentioned above, right? ("We can have a dom package for use of
the DOMDocumentSerializer and DOMDocumentParser.")

>
> - The DOM example and the use of a transform does not represent FI
> best practices because the use of the transformer is slow. My
> preference would be to remove this from the sax package and then add a
> new package called 'transform' where samples using transforming to and
> from various sources can be used and where we can state
> advantages/disadvantages.
>
We don't have DOM examples currently, do we? Or are you referring to
the ones under tools package, not fi/samples?
For the ones under fi/samples, I'll remove the dependencies on the
transformer, and create a transform package.

> - The DOM serializing example is broken since the BuilderFactory does
> not turn on namespaces. Once this is done you will find that it does
> not work. Alan, has found an issue with using DOMSource or SAXSource
> to SAXResult when namespaces are present.

Are you referring to samples.sax.FISerializer or
tools.FI_DOM_Or_XML_DOM_SAX_SAXEvent? Your next email said it's fixed,
and I noticed FI_DOM_Or_XML_DOM_SAX_SAXEvent had been changed.

Joe

>
> Paul.
>