|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping immediate follow sibling
Tempore 13:44:35, die 01/31/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Paul Clarke
<pclarke@xxxxxxxxxxxxxxxx>:
Hello,Hi, In an XPath one-liner, that could be something like 'following-sibling::ProgAbs[count(current()|preceding-sibling::p[1])=1]' But because of performance reasons, a recursive approach would be better I think. e.g: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="bodyFrag"> <xsl:apply-templates select="p"/> </xsl:template> <xsl:template match="p"> <h1><xsl:value-of select="."/></h1> <p> <xsl:apply-templates select="following-sibling::*[1][self::ProgAbs]"/> </p> </xsl:template> <xsl:template match="ProgAbs"> <xsl:value-of select="."/> <xsl:apply-templates select="following-sibling::*[1][self::ProgAbs]"/> </xsl:template> </xsl:stylesheet>
|
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
|

Cart








