Well, it depends on the implementation, of course.
For Saxon, child::*[1], though child::Total_Size[1] will only take a nanosecond
or two longer. Avoid child::TotalSize, because this will search all the
children (it doesn't know there is only one).
Michael Kay
Saxonica
On 12 May 2019, at 12:43, Costello, Roger L. costello(_at_)mitre(_dot_)org
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Hello XSLT experts!
I want to retrieve the first child element. The children consist of a
<Total_Size> element followed by many <String> elements (perhaps thousands of
<String> elements).
<COFF_String_Table>
<Total_Size>4443</Total_Size>
<String>.eh_frame</String>
<String>.debug_aranges</String>
<String>.debug_info</String>
...
</COFF_String_Table>
Question: What is the most efficient XPath for selecting the first child
element (the <Total_Size> element)? Assume the context node is the
<COFF_String_Table> element. Which of these is the most efficient XPath
expression:
(a) child::*[1]
(b) child::Total_Size
(c) something else (what?)
/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
--~--