users@fi.java.net

Re: Example code

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 25 May 2006 18:13:32 +0200

Michael Seminaro wrote:
> Thanks Paul for the response. I looked at the junit test and it seems
> pretty straight forward, but using the SAX serializer isn't pretty labor
> intensive. Any way to do it using DOM or another XML object model?
>

For DOM, unforuntately at the moment the answer is no. The current
support for encoding binary content requires extentions to the API and
for DOM it is not so obvious what those extentions should be. For SAX it
is easy to support many Java primitive types by use of another handler.
For StAX the serializer currently supports encoding of binary content
that would otherwise be base64 encoded via a proprietary extension i.e.
not in the "org.jvnet.fastinfoset" namespace.

Paul.

> I will watch your blog for future posts as well.
> --
> *Michael Seminaro
> *
> Sun Microsystems, Inc.
> Phone: x53182/+1-703-579-1969
> Email: michael.seminaro_at_sun.com <mailto:michael.seminaro_at_sun.com>
>
>
> On May 24, 2006, at 9:16 AM, Paul Sandoz wrote:
>
>> Hi Michael,
>>
>> Next week i will do the following:
>>
>> - write a blog on this subject, see here [1]; and
>>
>> - write some sample code.
>>
>> In the mean time you could look at the JavaDoc, in particular the SAX
>> serializer/parser and the:
>>
>> org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler
>>
>> If you are feeling a little braver you could take a look at the
>> AlgorithmTest [2] JUnit test case (see method
>> createBuiltInTestFastInfosetDocument).
>>
>> Paul.
>>
>> [1] http://blogs.sun.com/roller/page/sandoz
>> [2]
>> https://fi.dev.java.net/source/browse/fi/FastInfoset/test/algorithm/AlgorithmTest.java?view=markup
>>
>> Michael Seminaro wrote:
>>
>>> Can you point me to any example code or documentation for this API,
>>> other than the really brief examples that exist on the "how to use:"
>>> page? In particular, I would like to know how to build up an XML
>>> document with binary content, in memory, and have that serialized to
>>> a fast infoset document without performing any character encoding on
>>> the binary data.
>>> Thanks.
>>> --
>>> *Michael Seminaro
>>> *
>>> Sun Microsystems, Inc.
>>> Phone: x53182/+1-703-579-1969
>>> Email: michael.seminaro_at_sun.com <mailto:michael.seminaro_at_sun.com>
>>
>>
>> --
>> | ? + ? = To question
>> ----------------\
>> Paul Sandoz
>> x38109
>> +33-4-76188109
>
>

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