let $n := <node>(1 + (2 * 3)) / (x)</node>,
$cp := fn:string-to-codepoints($n/string())
return count( $cp[. eq 40 ] ) eq count( $cp[ . eq 41 ] )
-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell: +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>
From: [email protected]
[mailto:[email protected]] On Behalf Of sini narayanan
Sent: Sunday, June 30, 2013 1:05 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] check for opening and closing Parentheses
Hi All,
How do i make sure that if a node value has 'n' opening Parentheses , it has
equal number of closing Parentheses ?
Is there an easy way to achieve this other than checking with fn:contains?
Thanks,
Sini
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general