Attribute values and Ancestors

Subject: Attribute values and Ancestors
From: "Dan Walker" <dew@xxxxxxxxxxxx>
Date: Tue, 15 Dec 1998 17:57:45 -0500
Hi all,

I'm rather new to XSL, but have a quick question.  When I am in a nested
<xsl:for-each ...> block, I can get the value of an inner attribute by
doing:

	{attribute(id)}

But, how do I get the value of an outer attribute?

In the following example, I am trying to build an HTML input field.  I want
to assign the value of the id attribute that belongs to <question> to the
name parameter of the input field (see ??? below).  All I have been able to
figure out is how to get the value of the id attribute belonging to
<choice>:

<xsl:for-each select="document/question">
	<FONT face="Arial"><xsl:process select="description"/></FONT>
	<P></P>
	<xsl:for-each select="choice">
		<TABLE><TR><TD>
		<input type="Radio" name="???"  value="{attribute(id)}"></input>
		</TD><TD>
			<xsl:process-children/>
		</TD>
		</TR>
		</TABLE>
	</xsl:for-each>
	<P></P>
</xsl:for-each>

Thanks,

Dan Walker
Merrimac Interactive Media


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread