首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

XSL怎样获取属性名称为变量的属性,该怎么处理

2012-04-07 
XSL怎样获取属性名称为变量的属性script languagejavascript typetext/javascriptxsl:variable n

XSL怎样获取属性名称为变量的属性
<script language="javascript" type="text/javascript">
 <xsl:variable name="proCount" select="count(@*[starts-with(name(),'a')])"/>
 proCount = "<xsl:value-of select="$proCount"/>";
 <![CDATA[
 for(i = 1; i <= proCount; i++)
 {
  priName = "a"+i;
 ]]>
  sss = "<xsl:value-of select="priName" />";
  alert(sss);
 <![CDATA[
 }
 ]]>
</script>

priName为变量!这样写不行!要怎么写啊!

[解决办法]

XML code
arr = [ <xsl:for-each select="//note/@*[starts-with(name(),'a')]">'<xsl:value-of select="."/>'<xsl:if test="position()!=count(//note/@*[starts-with(name(),'a')])">,</xsl:if></xsl:for-each> ]; 

热点排行