xsl-list
[Top] [All Lists]

[xsl] Which XPath evaluates faster: count(../A) eq 1 or not( following-sibling::A)

2014-11-04 07:57:05
Hi Folks,

I am positioned in the XML tree at the first <A> element, within a <parent> 
element.

Requirement: There must be only one <A> element within <parent>.

Here are two XPath expressions to check that there is only one <A> element:

        count(../A) eq 1

or

        not(following-sibling::A)

Which XPath expression evaluates faster?

/Roger
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>