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

RE: XSLT1.0 and wildcards

Subject: RE: XSLT1.0 and wildcards
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 3 Oct 2006 08:54:34 +0100
substring before wildcards
> For example The address line is like this: melkweg 51a.
> 
> This means I have to map this like this:  street = melkweg, 
> number = 51, extension = a
>     I wanted to use the  'substring-before' function to 
> filter out the street, and 'substring-after' function to 
> filter out the extension. I could use the number 51 for this 
> but that's only the case for this line. Can i use some kind 
> of wildcard character say '*' that defines that It just has 
> to be a number.
> Are there such wildcards, and/or is there a better way to do this?
> 

XSLT 1.0 is very limited for this kind of string manipulation, but you can
often achieve what you need with the help of translate(). For example,
translate($x, '012345789', '9999999999') will convert all digits to 9s,
which makes  it possible to use substring-before(translate($x, '012345789',
'9999999999'), '9') to find the text that precedes the first digit. Or given
the string "51a", you can extract the "a" using translate($x, '0123456789',
'').

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.