Subject: Re: [xsl] how to test previous node name From: Kamal Bhatt <kbhatt@xxxxxxxxx> Date: Mon, 12 Feb 2007 08:40:33 +1100 |
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:
I have an XML input:
<test1> <item></item> <text></text> <item></item> </test1>
How do I check if the previous node name for <item> is test1 or text?
select="preceding::*[1][self::item1 or self::text]"
cheers andrew
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="item" mode="text"> ...processing for text... </xsl:template>
<xsl:template match="item" mode="test1"> ...processing for text... </xsl:template>
-- Kamal Bhatt
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to test previous node, Andrew Welch | Thread | Re: [xsl] how to test previous node, Abel Braaksma |
[xsl] Making an FAQ page from XML, John Steel | Date | Re: [xsl] Making an FAQ page from X, Kamal Bhatt |
Month |