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

Escaping special characters for *nix file path

Subject: Escaping special characters for *nix file path
From: Lighton Phiri <lighton.phiri@xxxxxxxxx>
Date: Sun, 29 Jul 2012 04:43:49 +0200
 Escaping special characters for *nix file path
I am trying to dynamically create a *nix compatible file path by
pulling information off of database tables. A number of resulting
paths have special characters that need to be escaped to be considered
valid file paths. The path below is an example of what I am dealing
with

/data/Sites/3218AD Eland's Bay/Bobbejaansberg/BB15/

For path above to be valid in *nix, I need to escape 'spaces', 'single
quote' with 'backslash' to get output below

/data/Sites/3218AD\ Eland\'s\ Bay/Bobbejaansberg/BB15/

I've been trying to play around with the 'replace' function and
'disable-output-escaping', but can't seem to make it work --see
snippet below.

 <xsl:value-of select="replace(replace(replace(replace(replace($filename,
' ', '\ '), '\&#40;', '\&#40;'), '&#41;', '\&#41;'), '&#91;',
'\&#91;'), '&#93;', '\&#93;')" disable-output-escaping="yes" />

How do I escape the special characters in my dynamically created path?

Lighton Phiri
http://lightonphiri.org

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.