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

Re: Converting XML to an Escacped URL

Subject: Re: Converting XML to an Escacped URL
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 30 Oct 2005 18:50:57 +0000
data text html base64
>>>>> "Gary" == Gary Stewart <the.stewarg@xxxxxxxxx> writes:

    Gary> On 30 Oct 2005 18:13:24 +0000, Colin Paul Adams
    Gary> <colin@xxxxxxxxxxxxxxxxxx> wrote:

    Gary> Yeah; I am aware of that as a problem. I'm using it for
    Gary> testing really and the documents are quite short. I'll have
    Gary> to get POST working in the near future though :).

    >> Anyway, you have 3 functions in XPath 2.0 for escaping
    >> characters.  I take it you are using XML 1.1?

    Gary> XML 1.0 though I could start using 1.1. Is there a way of
    Gary> getting the nodeset as a string then?

The version of XML is irrelevant for this.
I was wondering if 1.0 element names need escaping at all.
But the text certainly will.

So I think you want a stylesheet that specifies xsl:output
method="text".

Then a template somthing like:

<xsl:template match="/">
data:text/html;charset=US-ASCII;base64,<xsl:apply-templates/>
</xsl:template

Then in subsequent templates write out the base64 encoding (you can
write an xsl:function for this) of each node.

Alternatively, you can omit the base64, and %encode everything with
escape-html-uri (if that's the right function for the data URI
scheme. (The RFC says:

"without ";base64", the data (as a sequence of
   octets) is represented using ASCII encoding for octets inside the
   range of safe URL characters and using the standard %xx hex encoding
   of URLs for octets outside that range."
)
-- 
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.