This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to check if a string as numbers in XSLT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to check if a string as numbers in XSLT" Watch "How to check if a string as numbers in XSLT" New topic

How to check if a string as numbers in XSLT

vinodreddy kisanagaram

Joined: Jan 08, 2008
Posts: 9
Hi ,

Can you please let me know the function name and usage to find if a given string has numbers in it... like

"app3le" has 3 in it..

I have found one function in w3schools website:


which returns true if string1 contains string2, otherwise it returns false

Example: contains('XML','XM')
Result: true

but using this function and looping it 10 times (i.e., from 0-9) is bit tedious.

Can you suggest some other way...

Thanks in advance

***<br />K Vinod Reddy
Pavel Cherkashin
Ranch Hand

Joined: Mar 04, 2005
Posts: 47
XSLT 2.0 support regular expression.
Regard these links:
the good publication

the chapter from tutorial

the official xslt 2.0 specification (very long html document)-chapter 15 is about regexps

The can be usable as a xslt reference (elements, functions etc)
[ February 28, 2008: Message edited by: Pavel Cherkashin ]

Pavel Cherkashin - <br />SCJP, SCWCD, SCDJWS, SCBCD, SCEA, ...<br />
I agree. Here's the link:
subject: How to check if a string as numbers in XSLT
Similar Threads
garbage collection
String intern
Checking whether a string is a substring of another string without using indexOf method
String equality