[xsd-users] How to serialize character reference i.e. 

Jack Reese jackson.reese at gmail.com
Tue Apr 19 12:15:17 EDT 2011


Excellent - thanks Boris. Substituting "\r" in place of the character
constant 
 works perfectly for serialization.

However, when I now parse the resulting XML, the character constant 
seems to be dropped out and I'm just left with the string and no character
constant.

Is there something else I need to do in order to recover the carriage return
upon parsing?

Thanks again,

~ jr



On Tue, Apr 19, 2011 at 8:36 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Jack,
>
> Jack Reese <jackson.reese at gmail.com> writes:
>
> > When serializing a string that contains "*foo &#**xD; bar*" the resulting
> > string in the generated XML is converted to "*foo &amp;#xD; bar*" (the "*
> > amp;*" is added following the "*&*" - as if the "*&#**xD;*" character
> > reference was not recognized.
>
> You need to use the actual character value in UTF-8 (unless you changed
> the encoding with --char-encoding) instead of a char reference. The
> serializer will automatically convert it to a reference if necessary.
>
> Boris
>


More information about the xsd-users mailing list