This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:param
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] xsl:param
- From: the matrix <matrxuk at yahoo dot co dot uk>
- Date: Tue, 17 Apr 2001 19:29:51 +0100 (BST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Although the "$member-position" is in "Name template
match" section, it doesn't
show up when the Name tamplate is applied in the
"Repeat template match"
section. I am not very good at explaining the problem
but if you can see what I
am trying to say, please guide me.
Here is the XML:
<Group>
<Member>
<Name>Jack</Name>
</Member>
<Member>
<Repeat>
<Name>Jill</Name>
</Repeat>
</Member>
</Group>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="Group/Member"/>
</xsl:template>
<xsl:template match="Member">
<xsl:apply-templates select="*">
<xsl:with-param name="member-position"
select="position()" />
</xsl:apply-templates>
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">Member<xsl:value-of
select="position()"/></xsl:attribute>
<xsl:attribute name="value"/>
</xsl:element>
<br/>
</xsl:template>
<xsl:template match="Repeat">
<xsl:element name="input">
<xsl:attribute name="type">Submit</xsl:attribute>
<xsl:attribute name="name">+</xsl:attribute>
<xsl:attribute name="value">+</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="Name"/>
</xsl:template>
<xsl:template match="Name">
<xsl:param name="member-position" />
Name:
<xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">Name<xsl:value-of
select="$member-position"/>
<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:element>
<br/>
</xsl:template>
</xsl:stylesheet>
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list