[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] xsl:param


Subject: [xsl] xsl:param
From: the matrix <matrxuk@xxxxxxxxxxx>
Date: Tue, 17 Apr 2001 19:29:51 +0100 (BST)

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 @... address at http://mail.yahoo.co.uk
or your free @... address at http://mail.yahoo.ie

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



Current Thread
  • [xsl] xsl:param
    • the matrix - Tue, 17 Apr 2001 19:29:51 +0100 (BST) <=
      • <Possible follow-ups>
      • RSuiter - Tue, 17 Apr 2001 14:45:48 -0500