Subject: Re: [xsl] Usage of XSLT in the field of text replacement. From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 09 Oct 2008 08:12:06 -0400 |
Here is a 2.0 solution for this (let's say this file is test.xsl),
... <xsl:variable name="regex-pattern" select="string-join(for $x in $replacement-data return (if (starts-with(substring-before($x,'|'),'[') and ends-with(substring-before($x,'|'),']')) then concat('\',substring(substring-before($x,'|'),0,string-length(substring-before($x,'|'))),'\]') else substring-before($x,'|')),'|')" /> ... <xsl:analyze-string select="." regex="{$regex-pattern}"> ... temp.ini
1|ONE 2|TWO 3|THREE 50|FOUR [text]|[TEXT] ... On Wed, Oct 8, 2008 at 4:09 PM, J. S. Rawat <jrawat@xxxxxxxxxxxxxx> wrote: > Hi > Can xslt2.0 play a role in the field of text replacement. I want to > transform an xml to another xml and want to replace some text as well. For > that purpose I want to restore "find and replace" text in a separate file > with pipe separated delimeter.
-- Upcoming XSLT/XSL-FO hands-on courses: Wellington, NZ 2009-01 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video sample lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg Video course overview: http://www.youtube.com/watch?v=VTiodiij6gE G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Usage of XSLT in the fiel, Mukul Gandhi | Thread | Re: [xsl] Usage of XSLT in the fiel, Mukul Gandhi |
Re: [xsl] Still thinking to object , Jonas Bassl | Date | Re: [xsl] Usage of XSLT in the fiel, Mukul Gandhi |
Month |