[xquery-talk] Help with trimming down an XPath expression

Jeff Dexter jeff.dexter at rainingdata.com
Mon Apr 24 12:02:02 PDT 2006


Todd,
 
            I'm not sure if it's terser, but you can employ a
QuantifiedExpr to generalize it a little better, as in.
 
            //pre[ some $i in ( 'string', 'void', 'int', 'float', 'bool'
) satisfies starts-with( ., $i ) ]
 
Jeff Dexter.
www.rainingdata.com
 
-----Original Message-----
From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On Behalf
Of Todd Ditchendorf
Sent: Monday, April 24, 2006 10:30 AM
To: talk at xquery.com
Subject: [xquery-talk] Help with trimming down an XPath expression
 
Hi gang,
 
I'm looking for a way to trim this expression down:
 
 
//pre[starts-with(.,"string") or starts-with(.,"void") or
starts-with(.,"int") or starts-with(.,"float") or starts-with(.,"bool")]
 
 
 
Basically, I'm looking for an XPath 2.0 expression that will locate a
<pre> element anywhere in my document whose string-value starts with one
of : "string", "void", "int", "float", or "bool"
 
Is there any way to express this a little more tersely?
 
 
 
Todd Ditchendorf
 
 



 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20060424/41c09ec0/attachment.htm


More information about the talk mailing list