xsl-list
[Top] [All Lists]

RE: [xsl] Issue with child:: element

2006-11-20 16:20:46
                      <xsl:if test="child::*[1][self::note]">
                              <xsl:apply-templates 
select="note" mode="level1"/>
                      </xsl:if>


That says "if the first child is a note then display all the child notes." 

I suspect you wanted to say "if the first child is a note then display it".

That's simply:

<xsl:apply-templates select="child::*[1][self::note]" mode="level1"/>

(which does nothing if the first child is not a note).

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>