Hi there, I have, what I believe to be, an interesting situation at hand. I have a car garage XML and am transforming it (using XSL) into HTML.
CAR XML:
<car>
<licensePlate>Car001</licensePlate>
<feature>
<color>Blue</color>
<fuel>Unleaded</fuel>
<feature>
</car>
I only want to print out <color>
& <fuel>
but want to set the <licensePlate>
as href in a HTML link.
CAR XSL:
<xsl:template match="car">
<tr>
<xsl:apply-templates select="licensePlate"/>
<xsl:apply-templates select="feature"/>
</tr>
</xsl:template>
<xsl:template match="feature">
<td>
<a href="{preceding-sibling::licensePlate/text()}>
<xsl:apply-templates select="color"/>
</a>
</td>
<td><xsl:apply-templates select="fuel"/></td>
</xsl:template>
This enables me to achieve my goal of setting the tag as the href value.
BUT a problem occurs...all of the values of licensePlate are printed to screen.
Can someone recommend how to prevent it from printing to screen?
I have tried commenting out <xsl:apply-templates select="licensePlate"/>
but I think this affects the preceeding-sibling::
statement as I receive an error
I have also received this error when trying to apply a CSS display:none
.
Thankyou for your time and patience, Lucas