I agree, but escaping via � etc is not an option to my knowledge. Control
characters are illegal in XML, regardless of encoding.
I thought yesterday about the following alternative options:
- use XML1.1 and find an "special" solution for 0x0. XML 1.0 standard does
not allow most of the characters under 0x20 (except for 0x9, 0xA and 0xD).
XML 1.1 allows 0x1-0x20, but still blocks 0x0.
- encode UTF8v as Base64.
- use <![CDATA[]]> block, e.g
<rp:ReaderFirmwareVersion>3.0.1.240<![CDATA[\0]]>;</rp:ReaderFirmwareVersion
>
(Note: you won't be able to use an XML parser to parse the CDATA element!)
- Christian
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of John R. Hogerhuis
> Sent: Freitag, 29. Februar 2008 12:53
> To: LLRP Toolkit Development List
> Subject: Re: [ltk-d] Java LTK and non XML characters
>
> On Fri, Feb 29, 2008 at 9:21 AM, Gordon Waidhofer
> <[EMAIL PROTECTED]> wrote:
> >
> > It turns on the definition of string.
> > The spec is no help.
> >
> > LTKC and LTKCPP treat strings as nul terminated.
> > When printing if the last character is nul it is omitted.
> > Each interior nul is escaped.
>
>
> We need to fill the gap in the standard here in a way that
> makes sense for all LTK libraries and XML, while respecting
> whatever we can guess the standards writers intended. I think
> making a "special" NULL terminator is "adding" something to
> the spec that isn't there. There is already a sufficient
> mechanism for terminating the utf8v's: the byte count. So a
> NULL terminator is redundant.
>
> Nevertheless at present there is a bug in the LTK-Perl
> implementation, in that control characters need to be quoted
> and preserved. For example, what would we do with this
> (valid, in that there is nothing in the standard which
> disallows it) utf8v:
>
> HW.V.6\0SW.V.8\0;
>
> I think this should appear in LTK-XML as HW.V.6�HW.V.8�
>
> If any libraries truncate that to HW.V.6 then that certainly
> seems to me like a bug.
>
> What do others think?
>
> -- John.
>
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by: Microsoft Defy all
> challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> llrp-toolkit-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
llrp-toolkit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel