Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Replacing a string segment inside a variable? >Thread Next - Re: Replacing a string segment inside a variable? Re: Replacing a string segment inside a variable?To: NULL Date: 7/21/2009 8:55:00 AM Thanks Martin! I did neglect to mention that I'm using xslt 1.0, so I'm trying the latter part of your answer. Cheers! > > XSLT 2.0: > =A0 =A0<a href=3D"{replace(@ows_URL, '/DispForm', > '/EditForm')}&Source=3D{$PageUrl}">Click This</a> > Note that replace takes a regular expression pattern as the second > argument, I think I have choosen a string with '/DispForm' that does not > contain any characters that need to be escaped but be careful if you > want to change the above sample so that you escape anything that needs > to be escaped. > > With XSLT 1.0 there is no replace unless you implement it with a named > template that you then need to call inside of an xsl:attribute. On the > other hand for the string you have doing > =A0 =A0<a href=3D"{concat(substring-before(@ows_URL, '/'), > '/EditForm.aspx')}&Source=3D{$PageUrl}">Click This</a> > should suffice. > > -- > > =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML > =A0 =A0 =A0 =A0http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
