[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Optimizing preceding-sibling & following-sibling a
Martynas,
You could work with a key defined like this: <xsl:key name="headers-with" match="h6" use="generate-id(preceding-sibling::* [self::h5|self::h4|self::h3|self::h2|self::h1][1])"/> <xsl:key name="headers-with" match="h5" use="generate-id(preceding-sibling::* [self::h4|self::h3|self::h2|self::h1][1])"/> <xsl:key name="headers-with" match="h4" use="generate-id(preceding-sibling::* [self::h3|self::h2|self::h1][1])"/> <xsl:key name="headers-with" match="h3" use="generate-id(preceding-sibling::* [self::h2|self::h1][1])"/> <xsl:key name="headers-with" match="h2" use="generate-id(preceding-sibling::h1[1])"/> Calling key('headers-with',generate-id(.)) will then get you all the headers that belong to the current node, if it's an h1-h5. I can't speak for how fast the indexes would be to build -- in general, flat data sets present the potential for problems no matter what -- but they should be plenty fast to use. Cheers, Wendell At 02:56 PM 4/7/2010, you wrote: Hey, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
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
|