You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Christopher L. Ramsey" <ch...@hotmail.com> on 2012/03/21 17:47:31 UTC

XMLStreamWriter

I have some questions about the XMLStreamWriter? Would this serialize to an FileWriter and a FileInputStream or would this be able to filter to any stream or writer. I think it should be able to support any of them, and maybe use a string decoder if somebody wants a different encoding? What do you think?

--Christopher L. Ramsey

Re: XMLStreamWriter

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Christopher,

"Christopher L. Ramsey" <ch...@hotmail.com> wrote on
03/23/2012 12:03:51 PM:

> Sorry for the delayed reply,
>
> So when you mean native you mean C/C++  decoders?

I probably should have used the word custom. I meant developing
custom/optimized encoders for UTF-8, US-ASCII, etc...

Xerces has optimized decoders for several encodings, for example:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/io/UTF8Reader.java?view=log

That's for the parser. Optimized encoders would be for the serializer.

> If I am selected, are you sure this will take the whole summer?

It depends on your design and the scope of your proposal. I suggested on
the JIRA issue that the project could include more of the serialization API
(e.g. XMLEventWriter). If you chose to include custom encoders in the
design that would also give you more room for development.

> What happens if I get this wrapped up in a month? I am committed
> to the whole summer.

I think some students finish early and recall when I've filled out mid-term
evaluations in the past that there was a check-box for whether the
student's already finished. So it happens, and I think Google knows some
students would finish early. That said, if you feel you would be likely to
finish with time to spare it would be good if you add some optional stretch
goals in your proposal, things that you would do next if you finished the
main objectives of the project.

> Christopher L. Ramsey
>
> From: Michael Glavassevich
> Sent: Wednesday, March 21, 2012 13:10
> To: j-users@xerces.apache.org
> Subject: Re: XMLStreamWriter
>
> Hi Christopher,
>
> An XMLStreamWriter should be able to write to any
> java.io.OutputStream or java.io.Writer. It needs to take care of the
> encoding when the target is an OutputStream. This can be as simple
> as wrapping it in an java.io.OutputStreamWriter and as complex as
> having native support in the serializer for char to byte conversions
> (for each encoding), the latter usually being done in XML
> serializers for performance reasons.
>
> Thanks.
>
> Michael Glavassevich
> XML Technologies and WAS Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> "Christopher L. Ramsey" <ch...@hotmail.com> wrote on
> 03/21/2012 12:47:31 PM:
>
> > I have some questions about the XMLStreamWriter? Would this
> > serialize to an FileWriter and a FileInputStream or would this be
> > able to filter to any stream or writer. I think it should be able to
> > support any of them, and maybe use a string decoder if somebody
> > wants a different encoding? What do you think?
> >
> > --Christopher L. Ramsey

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: XMLStreamWriter

Posted by "Christopher L. Ramsey" <ch...@hotmail.com>.
Sorry for the delayed reply,

So when you mean native you mean C/C++  decoders? If I am selected, are you sure this will take the whole summer? What happens if I get this wrapped up in a month? I am committed to the whole summer.

Christopher L. Ramsey

From: Michael Glavassevich 
Sent: Wednesday, March 21, 2012 13:10
To: j-users@xerces.apache.org 
Subject: Re: XMLStreamWriter

Hi Christopher,

An XMLStreamWriter should be able to write to any java.io.OutputStream or java.io.Writer. It needs to take care of the encoding when the target is an OutputStream. This can be as simple as wrapping it in an java.io.OutputStreamWriter and as complex as having native support in the serializer for char to byte conversions (for each encoding), the latter usually being done in XML serializers for performance reasons.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Christopher L. Ramsey" <ch...@hotmail.com> wrote on 03/21/2012 12:47:31 PM:

> I have some questions about the XMLStreamWriter? Would this 
> serialize to an FileWriter and a FileInputStream or would this be 
> able to filter to any stream or writer. I think it should be able to
> support any of them, and maybe use a string decoder if somebody 
> wants a different encoding? What do you think?
> 
> --Christopher L. Ramsey

Re: XMLStreamWriter

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Christopher,

An XMLStreamWriter should be able to write to any java.io.OutputStream or
java.io.Writer. It needs to take care of the encoding when the target is an
OutputStream. This can be as simple as wrapping it in an
java.io.OutputStreamWriter and as complex as having native support in the
serializer for char to byte conversions (for each encoding), the latter
usually being done in XML serializers for performance reasons.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Christopher L. Ramsey" <ch...@hotmail.com> wrote on
03/21/2012 12:47:31 PM:

> I have some questions about the XMLStreamWriter? Would this
> serialize to an FileWriter and a FileInputStream or would this be
> able to filter to any stream or writer. I think it should be able to
> support any of them, and maybe use a string decoder if somebody
> wants a different encoding? What do you think?
>
> --Christopher L. Ramsey