Re: [xsl] Selecting Elements fo processing

Subject: Re: [xsl] Selecting Elements fo processing
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 05 Oct 2002 14:10:56 +0200
Hello Nickolay,

did you look at any tutorial or in any book? This is a question about the basics of XSLT.

<xsl:template match="root">
  <table border="1">
    <xsl:apply-templates select="item"/>

<xsl:template match="item">
    <xsl:apply-templates select="*"/>

<xsl:template match="car | potatoes">
    <xsl:value-of select="name()"/>
    <xsl:apply-templates select="*"/>

<xsl:template match="maxspeed | colour | quality | pack">
  <p><xsl:value-of select="name()"/>: <xsl:value-of select="."/></p>

<xsl:template match="price">
  <td><xsl:value-of select="."/></td>

The next time please read in FAQs or tutorials first.



Nickolay Kolev wrote:
Hi all,

I want to process something similar to:







so far I have:

<xsl:for-each select="item">
	<p><xsl:value-of select="price" /></p>

for getting the price element which is common to all items...

But how do I write:

if child element is car print "maxspeed is XXX and the colour is YYY"

else if child element is potatoes print "quality is XXX and the origin is YYY"

else if ...

else ...

I hope I have made myself clear.

Many thanks in advance,

XSL-List info and archive:

XSL-List info and archive:

Current Thread