Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have some issue in XSLT. Please see my XSLT code and also here have the XML datas. Please do needful.

<xsl:template match="/" xmlns:xsl="#unknown">
<html>
<head>
</head>
<body>

<xsl:for-each select="//Roles">
<xsl:element name="td">
<xsl:attribute name="value">
<xsl:value-of select="@instance">


<xsl:value-of select="@long_desc">




<xsl:call-template name="LoadGroups">


SubModule


</body>
</html>



XML
<xsl:template name="LoadGroups">

  <xsl:for-each select ="//Datas ">

    <xsl:variable name="i" select="position()"/>

    <tr>
      <xsl:element name ="td">
        <xsl:attribute name="value">
          <xsl:value-of select ="@submodule_instance"/>
        </xsl:attribute>
        <xsl:value-of select ="@submodules"/>
      </xsl:element>


      <xsl:for-each select ="//Roles">
        <xsl:element name = "td">
          <xsl:variable name="DynamicRoles" select ="@short_desc" />
          <xsl:value-of select ="//Datas[$i]/$DynamicRoles"/>;
Here i am getting the syntax error
Here i am getting the sysntax error

        </xsl:element>
      </xsl:for-each>


    </tr>

  </xsl:for-each>
</xsl:template>




XML
<root>
 <Datas submodules="My Settings - Broadcast Messages" MCA="Aravind" MCA_ID="201001" MGA="d" MGA_ID="200802"/>

<pre lang="xml">&lt;Roles instance=&quot;22982&quot; short_desc=&quot;MCA&quot; long_desc=&quot;Catalyst&quot; /&gt;
 &lt;Roles instance=&quot;22980&quot; short_desc=&quot;MGA&quot; long_desc=&quot;Group Architect&quot; /&gt;</pre>


</root>




IOf any one know please let me know
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900