Subject: [xsl] finding lowest level in ancestor:: axis From: Dan Vint <dvint@xxxxxxxxx> Date: Thu, 26 Jan 2006 13:56:10 -0800 |
<div1> <p>Some text here</p> <div2> <p>More text <ref idref="t1'/></p> <example> <table id='t1'/> </example> </div2> </div1>
<template match="ref"> <xsl:variable name="parent" select="id(@idref)/ancestor::div10 | id(@idref)/ancestor::div9 | id(@idref)/ancestor::div8 | id(@idref)/ancestor::div7 | id(@idref)/ancestor::div6 | id(@idref)/ancestor::div5 | id(@idref)/ancestor::div4 | id(@idref)/ancestor::div3 | id(@idref)/ancestor::div2 | id(@idref)/ancestor::div1 "/> <a href="{concat(generate-id($parent), '.html#', @idref)}"> Table <xsl:number level="any" from="div1" count="table" format="1"/> <xsl:text> </xsl:text> </a> </xsl:template>
<xsl:variable name="parent"> <xsl:choose> <xsl:when test="id(@idref)/ancestor::div10"> <xsl:value-of select="id(@idref)/ancestor::div10"/> </xsl:when> .... </xsl:choose> </xsl:variable>
thanks ..dan
PS still using XSLT v1 --------------------------------------------------------------------------- Danny Vint
Specializing in Panoramic Images of California and the West http://www.dvint.com
When H.H. Bennett was asked why he preferred to be out shooting landscapes rather than spending time in his portrait studio:
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Unsubscribing you from XSL-Li, Mulberry Technologie | Thread | Re: [xsl] finding lowest level in a, David Carlisle |
RE: [xsl] rounding within the "form, Michael Kay | Date | [xsl] Returning HTML tags from a fu, Agnisys |
Month |