[Home] [By Thread] [By Date] [Recent Entries]
Andrew Welch wrote:
On 2/11/07, xslt. new <xslt.new@xxxxxxxxx> wrote:OK, Andrew and I have different interpretations of what you said, further complicated by the fact that in your example, test1 is never preceding an item (it is the parent of the item). Here is what I had, based on what you requested then by what I assume you actually want.Hi all: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="test1"> <xsl:apply-templates select="item[preceding::*[1][local-name() = 'text']" mode="text"/> <xsl:apply-templates select="item[preceding::*[1][local-name() = 'test1']" mode="test1"/> </xsl:template> <xsl:template match="item" mode="text"> ...processing for text... </xsl:template> <xsl:template match="item" mode="test1"> ...processing for text... </xsl:template> </xsl:stylesheet> You could use parent::* in a similar way, if that is actually what you want. Cheers. -- Kamal Bhatt
|

Cart



