xsl-list
[Top] [All Lists]

Re: [xsl] How to substitute a portion of the text value of an element

2008-10-07 16:43:15
The difficulty I guess is knowing when to apply the translate.

Ken's code above in the thread:

 <xsl:copy>
   <xsl:value-of select="substring-before(.,$old)"/>
   <xsl:value-of select="$new"/>
   <xsl:value-of select="substring-after(.,$old)"/>
</xsl:copy>

needs to have the substring-before work if the slashes in $old and the
slashes in the . are different. Perhaps I need to first translate all
occurrences to some canonical form before I do the substring-before or
substring-after test if that is possible.

Paul


On Tue, Oct 7, 2008 at 4:13 PM, Syd Bauman <Syd_Bauman(_at_)brown(_dot_)edu> 
wrote:
Is there a function I can call to first convert the slashes to one
unified format before applying the substring?

translate(.,'\','/')


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--