简体   繁体   English

XSL无法解析foor循环

[英]XSL unable to parse foor loop

i'm using JavaScript for loop inside xsl document as follows: 我在xsl文档中使用JavaScript进行循环,如下所示:

     var x=xmlDoc.getElementsByTagName("section");
     for (i=0;i<x.length;i++)
            { 

                alert((x[i].getElementsByTagName("SectionId").nodeValue));
                alert((x[i].getElementsByTagName("SectionName").nodeValue));

            }

but i don't understand why the following error occurs: 但我不明白为什么会发生以下错误:

Element type "x.length" must be followed by either attribute specifications, ">" or "/>"

No need to add the <xsl:text disable... . 无需添加<xsl:text disable... You could try escaping the "<" character with &lt; 您可以尝试使用&lt;转义“ <”字符&lt; .

This is related: How to escape less than sign in javascript/jquery? 这是有关: 如何逃脱少于登录javascript / jquery?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM