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 January 21st, 2009, 04:37 PM
Authorized User
 
Join Date: Oct 2006
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Red face substring-before and substring-after

Hi. I'm using XSLT 1.0.

I have the following string:
GROUPA (EXCLUDE BOB, MIKE)

I like to separate the string into 2 strings:
GROUPA
(EXCLUDE BOB, MIKE)

I'm having an issue using substring-before and substring-after.
For example:
substring-after('GROUPA (EXCLUDE BOB, MIKE)', '(')
Output:
EXCLUDE BOB, MIKE)

I want the output to be:
(EXCLUDE BOB, MIKE)

I like the left parenthesis to be included in the output.
I also have the same issue with substring-before.

How do I that?
 
Old January 21st, 2009, 05:06 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Instead of substring-before (A, B), do

concat(substring-before(A,B), B)
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 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-before with Regex bonekrusher XSLT 6 November 27th, 2007 01:16 PM
substring-before() function. lafilip XSLT 1 July 11th, 2007 05:33 PM
SubString prasanta2expert Access VBA 1 November 17th, 2006 10:04 AM
How to find substring chrscote Classic ASP Basics 1 June 14th, 2003 03:13 AM





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