[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Pattern Matching a sting value

Subject: RE: Pattern Matching a sting value
From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxx>
Date: Fri, 6 Feb 2004 01:32:30 -0000
pattern matching in xsl
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> scott gabelhart
> Sent: 06 February 2004 01:14
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Pattern Matching a sting value

> How in XSLT 1.0 do you interogate a specific portion of a string?


> $stg = "font:...;font-family:Arial;color:#FFFFF;...."
> 
> I am only interested in the portion of this string that 
> contains Arial.

Not sure what interested means, if you want to test for the existance
use the boolean contains() function;

	contains($stg,'Arial') would return true

Otherwise use the following string based functions

	string substring-before(string, string)
	string substring-after(string, string)
	string substring(string, number, number?)
	string concat(string, string, string*)
	number string-length(string?)

You might need these as well;

	string normalize-space(string?)
	string translate(string, string, string)

Check out here for specific techniques;

http://www.dpawson.co.uk/xsl/sect2/N7240.html

Otherwise if you want something with regular expressions or more
advanced string handling like replacing text check out www.exslt.org.


Gl, Jim Fuller


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.