Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2007, 07:14 PM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default Trouble Isolating Substring in Quotes

Hello,

I have a node attribute captured to a string analogous to:

="<a target="_top" href="..\external content\High Level Case.doc#high_case">High Case</a>"

from which I am attempting to isolate:

..\external content\High Level Case.doc#high_case

The pattern of the attributes are consistent (always start ="<a target="_top" href=" and always end </a>").

Any help here is greatly appreciated. Thanks

 
Old February 19th, 2007, 04:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Something like this:

<xsl:variable name="quot">"</xsl:variable>
<xsl:variable name="hrefmarker"
  select="concat('href=', $quot)"/>
<xsl:variable name="s1" select="substring-after(@attribute, $hrefmarker)"/>
<xsl:variable name="s2" select="substring-before($s, $quot)"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
substring in c# sudhirbharti C# 1 February 21st, 2008 01:29 PM
SubString prasanta2expert Access VBA 1 November 17th, 2006 10:04 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Isolating element text EstherMStrom XSLT 6 September 17th, 2004 01:15 PM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.