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

Re: URI's, double backslashes and regular expressions

Subject: Re: URI's, double backslashes and regular expressions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 28 Oct 2010 20:03:18 +0100
Re:  URI's
On 28/10/2010 19:51, Neil Owens wrote:


I just can't figure out the syntax here

I'm passing a directory location into Saxon as a parameter. Only I need to make every '\' character in the (windows) directory path a '\\' for the uri in the transform. As it's only the transform that needs this I thought I'd do the conversion in the transform. And it's beaten me.


why? UROs never use \ to separate components they always use / and \ isn't an escape character in xpath strings so you never need to double \/


The command line param is: ...path="C:\Documents and Settings\Adminis
trator\My Documents\Projects\Transform\OutputFiles"

I've got this neatly passed into the transform with:

<xsl:param name="path"></xsl:param>
...
<xsl:template match="Log">
         <xsl:value-of select= replace($path, '\\', '\\')" />

         <xsl:variable name="Command" select="concat($path, '\\OutputFiles\\Command-output.xml')" />
         <xsl:result-document method="xml" href="{$Command}">
         .....


But fails and I just can't figure out how to achieve setting the result-document

href to equal "C:\\Documents and Settings\\Administrator\\My Documents\\Projects\\Transform\OutputFiles"


you want a URI not a windows file path with doubled \

file:///c:/Documents%20and%20Settings\\Administrator\\My%20Documents\\Projects\\Transform\OutputFiles

David

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.