Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] XSLT1.0 and wildcards

From: "Michael Kay" <mike@------------>
To:
Date: 10/3/2006 7:55:00 AM
> 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/


transparent
Print
Mail
Digg
delicious
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