Subject: Which is faster: count(/Document/A/B) eq 1 ... or ... /Document/A/(count(B) eq 1) ?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Wed, 19 Sep 2012 13:34:19 +0000
|
Hi Folks,
Consider this XML document:
<Document>
<A>
<B>blah</B>
</A>
</Document>
Here are two XPath expressions to test that there is exactly one <B> element
in the <A> element (assume there is only one <A> element):
1. count(/Document/A/B) eq 1
2. /Document/A/(count(B) eq 1)
Which is faster?
Is there an XPath expression, besides the ones listed, that is even better and
faster?
/Roger
|