You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Lucian Holland <le...@decisionsoft.co.uk> on 2006/10/04 10:04:04 UTC

Escaping routines

Hi,

I'm currently trying to complete the basic events part of the Xerces 
STaX implementation; one of the things that all the event objects need 
to be able to do is serialise themselves as a unicode string compliant 
with the relevant productions from the XML spec. Naturally this will 
involve doing a certain amount of escaping etc; while this isn't 
particularly hard, it seems like the kind of code that ought to exist in 
one place and be reused. Currently the obvious place that this code 
exists in Xerces is in the serialiser, and it doesn't really look like 
it's designed to be reused outside of there at the moment. I was 
thinking that it might make sense to factor some of the escaping out 
into a utility class somewhere, but IIRC there are plans afoot to move 
to common serialisation code anyway... Does anyone have any 
suggestions/opinions about the best course of action here? Are there 
some other escaping routines I should be looking at instead?

Thanks,

Lucian

-- 
Lucian Holland, Client Projects Manager  +44-1865-203192
DecisionSoft Limited                     http://www.decisionsoft.com
XML Development and Services


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Escaping routines

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

Lucian Holland <le...@decisionsoft.co.uk> wrote on 10/04/2006 04:04:04 AM:

> Hi,
> 
> I'm currently trying to complete the basic events part of the Xerces 
> STaX implementation; one of the things that all the event objects need 
> to be able to do is serialise themselves as a unicode string compliant 
> with the relevant productions from the XML spec. Naturally this will 
> involve doing a certain amount of escaping etc; while this isn't 
> particularly hard, it seems like the kind of code that ought to exist in 

> one place and be reused. Currently the obvious place that this code 
> exists in Xerces is in the serialiser, and it doesn't really look like 
> it's designed to be reused outside of there at the moment. I was 
> thinking that it might make sense to factor some of the escaping out 
> into a utility class somewhere, but IIRC there are plans afoot to move 
> to common serialisation code anyway... Does anyone have any 
> suggestions/opinions about the best course of action here? Are there 
> some other escaping routines I should be looking at instead?

I wouldn't bother doing any refactoring of that code. Xerces' native 
serializer will be deprecated as soon as the DOM L3 code gets migrated to 
use the Xalan serializer. I'm hoping that this will happen for Xerces 2.9.

If the escaping routines for the StAX events are general enough they could 
probably be added to XMLChar and XML11Char.

> Thanks,
> 
> Lucian
> 
> -- 
> Lucian Holland, Client Projects Manager  +44-1865-203192
> DecisionSoft Limited                     http://www.decisionsoft.com
> XML Development and Services
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org

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

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org