dev@fi.java.net

Re: Samples need updating

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 01 Mar 2005 13:40:15 +0100

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.

In this way we avoid the use of DOM and the transform.

Then we just have a class:

FastInfosetSerializer


> 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.


> 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 :-)


>
>>- 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.


>
>>- 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.


>
>>- 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.

Paul.

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