This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xsl unique position


Please can you help:

I am losing the variable due to duplication

<Group>
 <Member>
  <Name>Jack</Name>
 </Member>
 <Member>
  <Name>Jill</Name>
 </Member>
</Group>
-----------xsl-------
<xsl:template match="/">
 <html>
  <body>
   <xsl:apply-templates select="Group/Member"/>
  </body>
 </html>
</xsl:template>

<xsl:template match="Member">
 <xsl:apply-templates select="*"/>
 <xsl:element name="input">
  <xsl:attribute name="type">hidden</xsl:attribute>
  <xsl:attribute name="name">Member<xsl:value-of
select="position()"/><xsl:value-of select="position()"/></xsl:attribute>

  <xsl:attribute name="value"></xsl:attribute>
  </xsl:element><br/>
</xsl:template>

<xsl:template match="Name">
Name:
 <xsl:element name="input">
  <xsl:attribute name="type">text</xsl:attribute>
  <xsl:attribute name="name">Name<xsl:value-of
select="position()"/></xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>

  </xsl:element><br/>
</xsl:template>

The variables sent are -

Member1 =>
Name1 => Jack
Member2

Unfortunately I don't get the second name. I assume that Name1 means
it's position 1 in parent node "Member"
Which means that the second name will also have name1 as it's name and
the form has ignored it thinking it's a duplicate.

Please can you tell me if there is any way to solve this problem.



_____________________________________________________________
Pick up your email anywhere in the world ---> http://www.remail.net

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]