Using Reg Expressions in Xpath assertion
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008
08:48 AM
05-13-2008
08:48 AM
Using Reg Expressions in Xpath assertion
Hi,
Is it possible to supply a regular expression as the value to validate against in the xpath assertion rather than a wildcard character?
Cheers
Cormac
Is it possible to supply a regular expression as the value to validate against in the xpath assertion rather than a wildcard character?
Cheers
Cormac
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008
01:51 PM
05-13-2008
01:51 PM
Hi Cormac,
you can use the regex support in xpath 2.0 for this; if you want the text of a certain element to match a certain regex, specify the following:
matches( //somelement/text(), '.*' )
and set the expected value to true or false (whichever you want)
The matches function available in soapUI is documented at
http://www.saxonica.com/documentation/f ... tches.html
Hope this helps!
regards,
/Ole
eviware.com
you can use the regex support in xpath 2.0 for this; if you want the text of a certain element to match a certain regex, specify the following:
matches( //somelement/text(), '.*' )
and set the expected value to true or false (whichever you want)
The matches function available in soapUI is documented at
http://www.saxonica.com/documentation/f ... tches.html
Hope this helps!
regards,
/Ole
eviware.com
