santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Olav Linde" <Jon.Olav.Li...@beepscience.com>
Subject base64Binary, canonical form ?
Date Mon, 19 Dec 2005 14:31:25 GMT

Hi.

I am trying to find the correct canonical form of this
XML schema defined type: base64Binary

As far as I can read from the spec, the canonical form shall
contain no whitespace at all:

    Canonical-base64Binary  ::=  (B64 B64 B64 B64)*
                                ((B64 B64 B16 '=') | (B64 B04 '=='))?

(taken from http://www.w3.org/TR/xmlschema-2/datatypes.html#base64Binary)

However, when experimenting with the (Java) Canonicalizer class, using
the method ALGO_ID_C14N_EXCL_OMIT_COMMENTS, I see that it does include
whitespace (using xmlsec-1.2.1).

To illustrate, here is a sample XML fragment:
(For the sake of brevity, I use a line length of 4 instead of 76)

    <b64Data>U29t&#xd;
    ZSBk&#xd;
    YXRh&#xd;
    Lg==&#xd;
    </b64Data>

Using Xerces, with validation turned on, I parse the document containing
this fragment. Then, when I canonicalize the resulting root node,
this is what I get:

    <b64Data>U29t ZSBk YXRh Lg==</b64Data>


This element is defined in my experimental XML schema, like this:

	<element name="b64Data" type="base64Binary"/>

Am I reading the spec incorrectly, or is this a bug in the canonicalizer ?

Any help is appreciated.

/Jon Olav Linde



Mime
View raw message