This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Name of current node's parent?
- To: "XSL List" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Name of current node's parent?
- From: "Michael Lee" <mlee at kanhan dot com>
- Date: Thu, 4 Jan 2001 09:21:26 +0800
- Organization: kanhan.com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi, I am new to the list and XSL. In an XSLT stylesheet I am currently
working on, I want to compare the name of the current note's parent with a
string using <xsl:if>.
Let's say this is a fragment of an XML document:
<a>
<b></b>
<b><c></c></b>
<c></c>
<a>
Instead of using
<xsl:template match="b/c">
</xsl:template>
I want to use something like
<xsl:template match="c">
<xsl:if test="boolean-expression"></xsl:if>
</xsl:template>
To check and see if the parent of <c> is <b> or not. However, I am not very
familiar with XPath expressions and have no idea now to write the boolean
expression inside <xsl:if>.
Can someone help me?
Michael Lee
mlee@kanhan.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list