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

Re: URL encoding of UTF-8 data in MSXML

Subject: Re: URL encoding of UTF-8 data in MSXML
From: Marian Olteanu <mou_softwin@xxxxxxxxx>
Date: Wed, 8 Dec 2004 01:33:52 -0800 (PST)
msxml utf 8
JavaScript "escape" function does the job of URL-encoding.
To be able to define your function, use 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:user="urn:your-urn">

  <msxsl:script language="JavaScript" implements-prefix="user">
     <![CDATA[
      function URLEncode( s )
      {
         return escape( s );
      }
      ]]>
   </msxsl:script>
....
        <xsl:value-of select="user:URLEncode( expression )"/>
....


See also:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconXSLTStylesheetScriptingUsingMsxslscript.asp?frame=true

(doc. about C#, but it works also for any scripting language supported by Microsoft)




--- Bjorn Boxstart <Boxstart@xxxxxxxxxxxxxx> wrote:

>  
>  Hello all,
> 
> From within an XSL-T stylesheet I need to create HTML hyperlinks in the output HTML files. The
> data has UTF-8 encoding and so does the resulting HTML file. The data that is used for the links
> contains special characters and must therefore be URL encoded. I found a way to do this by use
> of named templates. The thing is however that this method (mentioned somewhere in the archive of
> this list) doesn't handle characters outside latin-1 correctly (e.g. russian texts). Because I
> use MSXML (must) I can't use the Java class and method URLEncoder.encode().
> 
> Can anybody tell me how to encode URL's from within a XSL-T stylesheet (run on a msxml
> processor). I know that a solution might be mentioned somewhere in the archive of this list, but
> that link doesn't seem to be working anymore.
> 
> Thanks in advance for your reaction!
> 
> Bjvrn
> 
> 


=====
Marian
http://www.utdallas.edu/~mgo031000/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.