Subject: Re: [xsl] finding next element after From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 02 Oct 2002 13:53:42 -0400 |
I got it, but want to make sure that I am not doing anything too funky here, as this is my first real foray into using axises.
<xsl:choose>
<xsl:when test="local-name(parent::node())='Link'">
<xsl:if
test="local-name(../../following-sibling::node())='Caption'">
<Caption>
<xsl:attribute name="align">
<xsl:value-of select="'bottom'" />
</xsl:attribute>
<xsl:value-of
select="../../following-sibling::node()" />
</Caption>
</xsl:if>
</xsl:when>
Thoughts? Is there an easier/better way to accomplish this?
<xsl:when test="parent::Link"> <xsl:for-each select="../../following-sibling::Caption"> <!-- this might better be ../../following-sibling::*[1][self::Caption] if you want to constrain it to the immediately following sibling; in any case if there's no Caption nothing happens, like your test --> <Caption align="bottom"> <xsl:value-of select="."/> <!-- but you might rather apply templates here --> </Caption> </xsl:for-each> </xsl:when>
Cheers, Wendell
====================================================================== 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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] finding next element afte, Nathan Shaw | Thread | RE: [xsl] finding next element afte, Michael Kay |
[xsl] Passing params dynamically fr, Uslu, Cihan Y (MED) | Date | [xsl] Re: absolute value function i, Dimitre Novatchev |
Month |