Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Replacing a string segment inside a variable?

From: ChrisG <chris@-----------.--->
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')}&amp;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')}&amp;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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent