Subject: Re: [xsl] XPath expression which checks that a string is between 1 and 10 characters in length? From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 26 Jul 2016 11:54:56 -0000 |
I need an XPath expression which returns true if the string in <A> is between 1 and 10 characters in length, and false otherwise.
For example, the XPath expression should return true on this XML:
<A>hi</A>
Here's an inefficient XPath expression:
(string-length(.) gt 0) and (string-length(.) le 10)
It's inefficient because it computes the string length twice.
Is there a more efficient XPath expression to solve this problem?
let $l := string-length() return ($l gt 0 and $l le 10)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XPath expression which checks, Costello, Roger L. c | Thread | Re: [xsl] XPath expression which ch, Wolfgang Laun wolfga |
[xsl] XPath expression which checks, Costello, Roger L. c | Date | Re: [xsl] XPath expression which ch, Martin Honnen martin |
Month |