问题描述
我在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"><Roles instance="22982" short_desc="MCA" long_desc="Catalyst" />
<Roles instance="22980" short_desc="MGA" long_desc="Group Architect" /></pre>
</root>
如果有人知道,请告诉我
IOf any one know please let me know
推荐答案
<root>
<Datas submodules="My Settings - Broadcast Messages" MCA="Aravind" MCA_ID="201001" MGA="d" MGA_ID="200802"/>
<pre lang="xml"><Roles instance="22982" short_desc="MCA" long_desc="Catalyst" />
<Roles instance="22980" short_desc="MGA" long_desc="Group Architect" /></pre>
</root>
如果有人知道,请告诉我
IOf any one know please let me know
这篇关于使用XML数据获取XSL转换中的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!