[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: grouping nesting items, including following items
On 6/19/07, Don Smith <dtsmithisogen@xxxxxxxxx> wrote:
I can't quite figure out how to group nested items and also pick up items on the following axis for a given group. Here's a sample source:
<xsl:template match="node()"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates select="node()[1]"/> </xsl:copy> <xsl:apply-templates select="following-sibling::node()[1]"/> </xsl:template> Then you just need to override it with a template containing the specific behaviour for elements with @newSlide = 'true': <xsl:template match="*[@newSlide = 'true']"> <xsl:result-document href="...."> <xsl:copy-of select="."/> <xsl:copy-of select="following-sibling::*"/> </xsl:result-document> </xsl:template> Notice how I've used copy-of instead of apply-templates here - you can only write one result document at once so nested @newSlide's would cause an error. To get around that don;t use xsl:result-document use a wrapper element, put the whole thing in a variable and then process that variable. Post back for an example of that if its needed. cheers andrew
|
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
|