dev@fi.java.net

Re: Samples need updating

From: Joe Wang <joe.wang_at_sun.com>
Date: Tue, 01 Mar 2005 08:42:07 -0800

On Tue, 2005-03-01 at 04:40, Paul Sandoz wrote:
> Joe Wang wrote:
> > 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
>
> FastInfosetParser is fine.
>
> I am thinking it might be better to have a specific example of Fast
> Infoset serializing using the SAX API i.e. making calls directly a bit
> like some of the algorithm unit tests.

So construct a small FastInfoset document like you did in
AlgorithmTest.createBuiltInTestFastInfosetDocument, rather than
transforming a XML file to FI doc? Making direct calls as in the method
(createBuiltInTestFastInfosetDocument).
We'll then create a couple of "transform" samples under transform
package.

>
> In this way we avoid the use of DOM and the transform.
>
> Then we just have a class:
>
> FastInfosetSerializer
>
Okay.

>
> > samples.sax.XMLToFI remove
> >
>
> Yes.
>
>
> > samples.stax.DocumentSerializer XMLtoFISerializing (same, but use StAX)
>
> Use XMLToFastInfosetSerializer since we have taken the position of using
> the full name rather than initials FI for other classe names.
>
I see.

>
> > samples.stax.EventReader EventParse (as in zephyr)
> > samples.stax.StreamReader CursorParse (as in zephyr)
> >
> > Please let me know.
> >
>
> Your nicely formated table got garbled by the emails :-)
>
My setting was "send in plain text". Next time, I'll try html format and
see if it preserve the table better.

>
> >
> >>- 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.")
> >
>
> Yes.

Okay.
>
>
> >
> >>- 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.
> >
>
>
> I am referring to the class samples.sax.FISeralizer creates a DOM
> Document and uses a transformer to transform the Document to a fast
> infoset document.
>
Okay.

>
> >
> >>- 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.
> >
>
> Sorry i was not clear. I am referring to samples.sax.FISeralizer class
> again.
>
Okay. Was just trying to make sure I understood it correctly.

Joe


> Paul.
>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_fi.dev.java.net
> For additional commands, e-mail: dev-help_at_fi.dev.java.net
>