Excellent.  That works perfectly.  The original value came into a
template as a parameter, so I just changed the "xsl:value-of" inside the
template to wrap the value with "translate()".

> -----Original Message-----
> From: Robert Houben [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 25, 2005 10:03 AM
> To: Karr, David
> Subject: RE: Change "\" in xsl:param value to "/"
> 
> 
> There is an XPath function called translate.  Where you call 
> your template, you could use:
> 
> <xsl:with-param name="myParam" select="translate(/x/y/@z,'\','/')"/>
> 
> Or you could set a variable.
> 
> HTH,
> 
> -----Original Message-----
> From: Karr, David [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 25, 2005 9:45 AM
> To: [email protected]
> Subject: Change "\" in xsl:param value to "/"
> 
> Along with JDK 1.4.2 and Ant 1.5.4, I'm trying to figure out 
> how to have a stylesheet modify an xsl:param value, replacing 
> any "\" characters in the value with "/" (or alternatively, 
> replacing "\" with "\\").  The parameter is provided through 
> Ant, in an environment variable.  The value will contain "\" 
> for path separators, and the resulting computed path has to 
> be valid in the Ant script that the stylesheet generates.
> 
> I see that in the EXSLT library, there are "split" and 
> "tokenize" methods (which seem to do the same thing).  If I 
> used "\\" as my delimiter, could I do something with a 
> template that somehow takes a nodelist and puts "/" in 
> between every node?  If that's the correct strategy, I'm not 
> sure how to get there.
> 
> I wish I had to work on stylesheets more than once a year.  
> This stuff would be easier then :) .
> 

Reply via email to