[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: What is the most efficient XPath expression for r
I think that, most preferred XPath expression for this requirement would be 'child::*[1]', or '*[1]' (I shall usually won't use the explicit axis name in this case). Other than efficiency, I think other principles of writing good XPath code might also suggest above expressions. On Sun, May 12, 2019 at 5:13 PM Costello, Roger L. costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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?) > -- Regards, Mukul Gandhi
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|