Hi Benoit,

Benoit Idieder wrote:

> Hi,
> 
> I am using xstream to serialize KeyStroke objects among other things,
> which give that kind of xml file :
> 
> <javax.swing.KeyStroke>
>     <keyChar>&#xffff;</keyChar>
>     <keyCode>116</keyCode>
>     <modifiers>0</modifiers>
>     <onKeyRelease>false</onKeyRelease>
> </javax.swing.KeyStroke>
> 
> But now I am facing an issue as I want to run an XSL transformation on my
> persisted xml files ; I get this when performing the transformation :
> Character reference "&#xffff" is an invalid XML character.

Simply register a custom converter as local converter for KeyStroke.keyChar. 
All it has to do is to write the character code as decimal. The consumer of 
this XML will have to know anyway that this field might contain -1 (short 
int) instead of a proper character.

> I realize that this char is invalid for the XML world, and that as a
> consequence the "standard" xml tools may fail parsing that xml file. But I
> found out that starting from a KeyStroke object and using TraxSource, I
> can perform successfully the XSL transformation.
> So is there a way to get a proper Source object from the xml file ?

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to