Looks like in case of fastinfoset it is possible to encode xml with Stax in
such way that decoding with Sax will fail.
On 4/17/07, Dennis Sosnoski <[EMAIL PROTECTED]> wrote:
IXMLReader is just a wrapper around whatever parser you want to use, but
it provides a pull-style interface so would be difficult to use with a
SAX parser (you'd basically need to buffer the parser output and then
access it on demand). Why would you want to use a SAX parser, though?
org.jibx.runtime.impl.StAXReaderWrapper is an implementation of
IXMLReader for StAX parsers, so you should be able to use that for both
direct StAX parser and Fast Infoset handling.
- Dennis
Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
[EMAIL PROTECTED] wrote:
> Yes. Would IXMLReader support both SAX and Stax?
>
> Thanks,
>
> /T
>
>
> On 4/16/07, *Dennis Sosnoski* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Hi /T,
>
> Switching between a regular StAX parser and one using Fast Infoset
on
> the fly is not something that's going to happen automatically with
> the
> framework. You can set the appropriate type of input source
> directly at
> the time of unmarshalling a document, though, by using the
> org.jibx.runtime.impl.UnmarshallingContext.setDocument(IXMLReader)
> method. Will that work for your purposes?
>
> - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> <http://www.sosnoski.co.nz>
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
> > Ilya,
> >
> > I can marshal java objects into binary xml using
> > com.sun.xml.fastinfoset.stax.StAXDocumentSerializer;
> >
> > IMarshallingContext mctx1 = bfact.createMarshallingContext();
> > mctx1.setIndent(2);
> > FileOutputStream outFi = new FileOutputStream("
> out.fi <http://out.fi>");
> > StAXDocumentSerializer sw = new
> StAXDocumentSerializer();
> > // Set the output stream
> > sw.setOutputStream(outFi);
> > mctx.setXmlWriter(new
> StAXWriter(bfact.getNamespaces(), sw));
> > sw.writeStartDocument();
> > mctx.marshalDocument(customer);
> > sw.writeEndDocument();
> >
> > But I cannot unmarshal it like
> >
> > IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
> > XMLStreamReader streamReader = new StAXDocumentParser(new
> > FileInputStream("filename.xml"));
> > Object obj = uctx.unmarshalDocument
> > (streamReader, null);
> >
> >
> > In the current state of jibx I have to create
> > org.jibx.runtime.impl.StAXReaderFactory and set it's name as
system
> > property which means that it wouldn't be possible to switch xml
> > encoding during runtime.
> >
> > In general if "someone asks about (are you going to support XXX)"
it
> > means that design is not extensible thus someone cannot do it
> himself
> > like xml parser selection.
> >
> > Thanks,
> >
> > /T
> >
> > On 4/12/07, Ilya Sterin <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >> It's always questionable when someone asks about (are you going
to
> >> support XXX). Fast Infoset is just a binary encoding for the
> >> traditional XML infoset. When your object is marshalled into
> an XML
> >> representation it can then be encoded into the XML infoset
> utilizing
> >> any other infoset support available out there. When you say
> support,
> >> do you mean bypassing the xml infoset representation and going
> >> directly to FI?
> >>
> >> Also, JiBX does support stax. You can find the information
> here...
> >> http://jibx.sourceforge.net/runtime.html#stax
> >>
> >> Ilya
> >>
> >>
> >> On 4/12/07, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> >>
> >>> Hello,
> >>>
> >>> Are there any plans to support Fastinfoset?
> >>> Or at least select Stax implementation at runtime?
> >>>
> >>> Thanks,
> >>>
> >>> /T
> >>>
>
-------------------------------------------------------------------------
> >>> Take Surveys. Earn Cash. Influence the Future of IT
> >>> Join SourceForge.net's Techsay panel and you'll get the chance
> to share your
> >>> opinions on IT & business topics through brief surveys-and
> earn cash
> >>>
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> <
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> >>> _______________________________________________
> >>> jibx-devs mailing list
> >>> [email protected]
> <mailto:[email protected]>
> >>> https://lists.sourceforge.net/lists/listinfo/jibx-devs
> >>>
> >>>
> >>>
> >>
>
-------------------------------------------------------------------------
> >> Take Surveys. Earn Cash. Influence the Future of IT
> >> Join SourceForge.net's Techsay panel and you'll get the chance
> to share your
> >> opinions on IT & business topics through brief surveys-and earn
> cash
> >>
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> <
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> >> _______________________________________________
> >> jibx-devs mailing list
> >> [email protected]
> <mailto:[email protected]>
> >> https://lists.sourceforge.net/lists/listinfo/jibx-devs
> >>
> >>
> >
> >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance
> to share your
> > opinions on IT & business topics through brief surveys-and earn
cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> <
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> > _______________________________________________
> > jibx-devs mailing list
> > [email protected]
> <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/jibx-devs
> >
> >
>
>
-------------------------------------------------------------------------
>
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> jibx-devs mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/jibx-devs
>
>
> ------------------------------------------------------------------------
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-devs mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-devs
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs