OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] SAX for Binary Encodings (SAD-SAX)

[ Lists Home | Date Index | Thread Index ]



> At 11:22 AM -0500 11/8/03, Bob Wyman wrote:
> 
> 
> >     public interface TypedContentHandler extends ContentHandler {
> >       public void values(java.lang.Object value)
> >          throws SAXException;
> >     }
> 
> 
> This won't work. There are numerous problems including:
> 
> 1. People want primitive data types often instead of objects.
> 2. It's type unsafe. OBject is not suitable replacement for 
> Date/Integer/int/etc.
> 3. What do you pass when the data doesn't match the schema?

Now, whether this should be called SAX or something else
is another question, but a better way to pass arbitrary
data would be to take advantage of existing knowledge
about marshalling/unmarshalling data across networks.

In short, in the content handler call-back, pass an UnMarshall
object, and when writing the data use a Marshall object.
In the case above, the Unmarshall object would then have
appropriate methods to indicate the basic data type
(like integer, boolean, string, ...) and a platform dependent
way of unmarshalling them. Sort of like RPC. One could
use the one of the existing ways of representing data
on the network for the binary encoding. 

Karl




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS