[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Portability of data URIs

Subject: Portability of data URIs
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Jun 2008 23:25:22 +0100
 Portability of data URIs
>>>>> "Michael" == Michael Kay <mike@xxxxxxxxxxxx> writes:

    Andrew> Settling on the complete function and which processors support
    Andrew> it would be good... although I guess using the data scheme is
    Andrew> just as processor dependent as an extension function.

    Michael> Arguably it's less portable, since there are no
    Michael> interrogatives to determine which URI schemes are
    Michael> supported...

In this case, there is a test. Fn:doc-available() is a reliable test for
the support of the data URI, in as much as it will return false() if
it is not supported, or if the URI is mal-formed, but will otherwise
return true(). Which is all that you need to know.

But as for what I said earlier today, about the only accurate thing was
that I was talking nonsense. Now I've had a couple of pints of mild
inside me, my thoughts are more lucid.
There is no problem with the encoding - you have to call
fn:encode-for-uri() to the content, and therefore declare the charset
as UTF-8.

So I think the best you can do for portability is to call
function-available on a data URI. If that returns true(), use that.
If not, call function-available() on known extension functions, one by
one.
Or try the extension functions first.

If all tests fail, then xsl:message.

As Andrew suggests, this could be written as a standard xsl:function.
It could then be placed it the FAQ.
-- 
Colin Adams
Preston Lancashire

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.