|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: ancestor
Has this test returned a value for you?
<xsl:if test="$inlineequation/@id=./@id"><xsl:value-of select="position()" /></xsl:if> My guess is that you are trying to do this: <xsl:if test=". = @id"> <xsl:value-of select="position()" /> </xsl:if> Which really doesnt make much logical sense iso then maybe the value you are passing in to the parameter 'inlinequation' contains an attribute id and you want to compare its value to the value of the current elements id attribute which would look like this: <xsl:if test="$inlineequation/@id = current()/@id"> <xsl:value-of select="position()" /> </xsl:if> But from your explanation it seems you are simply trying to generate sequential numbering which can be done by simply using the number element as such: <xsl:for-each select="//inlineequation[not(ancestor::table) and not(ancestor::figure)]"> <xsl:number/> </xsl:for-each> Or better yet just eliminate the named template all together and use apply-templates and the match attribute of the template as it was before and put the number element inside the template like so: <xsl:template match="inlineequation"> <xsl:number/> <xsl:value-of select="put desired output element here"/> </xsl:template> Not quite sure as to whether or not this helps or not as its unclear to me what it is you want to output and what type of ordering values need to be along side it. But hopefully this will get you going a little more in the right direction. Best of luck! <M:D/> Jiang, Peiyun wrote: Thanks, everyone!
|
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








