[xsd-users] bug report for xsd

Boris Kolpackov boris at codesynthesis.com
Mon Sep 18 05:07:56 EDT 2006


Hi Lixuesong,

Lixuesong <givemenews at tom.com> writes:

> Hi,
>   I found a bug on xml schema base64Binary type.
>
> ..
>
>   the output is:
>
> [lxs at mos117 /home/lxs/shay/xsd 1054]$ ./driver hello.xml
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <hello>
>
>   <greeting>Hello</greeting>
>
>   <name>xOO6
> </name>
>
> </hello>
>
> notice the output between <name> and </name>, why there is a line
> feed added?
> the output expected should be:  <name>x006</name>

XML Schema built-in type base64Binary is based on RFC2045 which
defines the Base64 encoding. According to the RFC, it is legal to
add a new line after the last line of encoding. While base64Binary
rules do not require a new line, it would not cause any problems
since this type performs whitespace collapsing (which includes
removing any leading or trailing whitespaces) before decoding. This
is stated in the section 3.2.16 of XML Schema Part2: Datatypes[1]
in the first note.

To summarize, this newline does not cause the content to become
invalid according to XML Schema and is explicitly valid according
to RFC2045. So I would not say this is a bug in XSD. Is it causing
trouble with any other XML Schema or Base64 processors?


[1] http://www.w3.org/TR/xmlschema-2/#base64Binary


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060918/bb559e35/attachment.pgp


More information about the xsd-users mailing list