This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how do I retrieve element node by predicating attribute value
- From: "Kimberly Hahn" <Kimberly dot Hahn at enform dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 12 Aug 2002 12:15:42 -0500
- Subject: RE: [xsl] how do I retrieve element node by predicating attribute value
- Reply-to: xsl-list at lists dot mulberrytech dot com
<cars>
<porsche maker="German"> pure racing </porsche>
<lexus maker="Japan"> luxury </lexus>
<ford maker="USA"> economy</ford>
<jaguar maker="UK">high-end luxury </jaguar>
</cars>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html"/>
<xsl:template match="cars/*">
<xsl:if test="@maker = 'German'">
<xsl:value-of select="name()"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
-----Original Message-----
in my snippet stylesheet, I would like to test the case for attribute value
that is 'German' and get return of 'porsche' as the element name, how do I
approach this problem?
<xsl:if test="//*[@maker = 'German'] ">
<!-- how would I retrieve element name 'porsche' -->
<xsl:value-of select=????/>
</xsl:if>
thanks,.
Ming
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list