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

Re: Xslt string Operation

Subject: Re: Xslt string Operation
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Aug 2016 20:13:25 -0000
Re:  Xslt string Operation
Actually, you want OutFileName to be a function of fileHref and outDir, and
you are asking us to work out what that function does from one example of its
input and output. To do this properly we need to know what the possible range
of values of fileHref and outDir is: for example, is fileHref always a Windows
filename using forwards slashes to separate the parts of the path? Will it
always end in ".xml"? Or since it's a param, might someone pass in a filename
using backslashes, with no file extension?

I would encourage you to use URIs rather than filenames. You could then use
the resolve-uri() function for at least part of the task.

Michael Kay
Saxonica

> On 24 Aug 2016, at 17:16, Mailing Lists Mail daktapaal@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Dear all,
> I have the following two params
> <xsl:param name = bfileHrefb select = b
bP:/developers/perf/bigPayload.xmlb b/>
> <xsl:param name="outDir" select="'outDir'"/>
>
>   I want OutFileName to be :
bP:/developers/perf/outDir/bigPayload-Formatted.xmlb
>
> Is there a better way to do this than what I did?
> <xsl:variable name="OutFileName" select=" substring-before($fileHref,
tokenize($fileHref,'/')[last() -1 ] ) || $outDir || '/' ||   substring-before(
tokenize($fileHref,'/')[last()] ,'.xml') || '-Formatted.xml'"/>
>
> thanks.
> Dt
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/293509> (by email <>)

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.