xsl-list
[Top] [All Lists]

Re: [xsl] Re: Identity transformation for XSLT 2.0

2007-12-23 09:04:08
"Florent" == Florent Georges <lists(_at_)fgeorges(_dot_)org> writes:

    Florent> Colin Paul Adams wrote:
    Florent>   Hi Colin,

    >> doc (concat ("data:application/xml", ';base64,',
    >> base64Binary($string-value)))

    Florent>   I don't know any function named base64Binary.  If you
    Florent> mean xs:base64Binary, I think it should raise an error if
    Florent> your string contains anything else than the 64 allowed
    Florent> chars.

I meant that, yes. I was thinking it would function as a converter,
but thinking again, you must be right.
 
    Florent>   Actually, I didn't find any simple way to base64-encode
    Florent> a string in F&O.  Did I miss something?

I guess an xsl:function could do it, but the percent-encoding way is
sufficient in this case.

    >> doc (concat ("data:application/xml,",
    >> encode-for-iri($string-value)))

    Florent>   I guess you mean encode-for-uri (URI, not IRI), don't
    Florent> you?

Yes.
I always get condused between those three encoding functions.

    Florent>   After a simple test (using the string '<elem/>' and its
    Florent> hard-coded base64 value 'PGVsZW0vPg==') it seems that
    Florent> Saxon 9 doesn't support the data scheme, while Gestalt
    Florent> supports it through encode-for-uri but raises a parsing
    Florent> error with the base64 encoding.

That sounds like a bug. Can you raise it with an example on
sourceforge please?
-- 
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--