使用XML数据获取XSL转换中的语法错误 [英] Geting the syntax error in XSL transformation with the xml datas

查看:89
本文介绍了使用XML数据获取XSL转换中的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在XSLT中有问题.请查看我的XSLT代码,这里还有XML数据.请做需要的事情.

< 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">


子模块


</body>
</html>



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>



<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>









<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

推荐答案

i]/


DynamicRoles" > ; 在这里我得到语法错误 这是系统错误提示 < /xsl:element > < /xsl:for-each > < /tr > < /xsl:for-each > < /xsl:template >
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>









<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


这篇关于使用XML数据获取XSL转换中的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆