[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Searching for elements in XML
> -----Original Message----- > From: Nestor Boscan [mailto:nestor.boscan@xxxxxxxxxx] > Sent: 04 July 2004 01:31 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Searching for elements in XML > > Hi > > In terms of performance which is better As with all performance questions, it depends on the product you are using, and the only way to find out is by measurement. Saxon rewrites "//a|//b|//c" as "/descendant::*[self::a or self::b or self::c]" which means it finds all the required elements in a single scan of the tree with no sorting. So this will probably be faster than three separate xsl:for-each instructions which scan the tree three times. But other products may differ. Michael Kay if I'm searching for > a number of > elements in the XML file and I don't care about the order: > > Let's say I'm searching for elements a, b and c: > > <xsl:for-each select="//a|//b|//c"> > </xsl:for-each> > > or > > <xsl:for-each select="//a"> > </xsl:for-each> > > <xsl:for-each select="//b"> > </xsl:for-each> > > <xsl:for-each select="//c"> > </xsl:for-each> > > or is there a better way? > > Thanks in advance > > Regards, > > Néstor Boscán > > > > --+------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --+-- > >
|
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
|