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?To: NULL Date: 7/21/2009 9:15:00 AM On Jul 21, 11:54=A0am, ChrisG <ch...@chrisgannon.com> wrote: > Thanks Martin! =A0I 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 no= t > > 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/- Hide quoted text= - Another question- how would I allow for multiple "/" in the url? i.e. the form isn't in the root but a sub-folder, or sub-sub-folder? I'm not sure how to make this dynamic. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
