是属性在某个相关标签中的顺序。具体情况:
这来自selenium测试文件。给出一个测试用例
<?xml version="1.0" encoding="UTF-8" standalone="no"?><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="selenium.base" href="http://10.9.10.100"/>
<title>SQL-Injection</title>
</head>
<body>
<table border="1" cellpadding="1" cellspacing="1">
<thead>
<tr><td colspan="3" rowspan="1">SQL-Injection</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/main.php?page=start.inc</td>
<td/>
</tr>
<tr>
<td>type</td>
<td>username</td>
<td>OR 1=1 #</td>
</tr>
<tr>
<td>type</td>
<td>password</td>
<td>OR 1=1 #</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>loginbutton</td>
<td/>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Bei dem Hack-Test dieser Webanwendung geht es darum möglichst viele Schwachstellen zu finden und erfolgreich auszunutzen</td>
<td/>
</tr>
</tbody></table>
</body>
</html>我们感兴趣的是:
<link rel="selenium.base" href="http://10.9.10.100"/>当按照上述方式指定时,Selenium IDE软件的fixed version将正确地解析它。但是,当我切换这两个参数时:
<link href="http://10.9.10.100" rel="selenium.base"/>Selenium IDE无法正确解析href属性。
我一直认为属性的顺序并不重要。是我错了,还是这是一个实现错误?
发布于 2010-06-14 22:04:05
在解析XML文件时,属性(通常)按从左到右的顺序放入文档树中(取决于实现)。因此,在现实世界中,顺序以某种方式影响了树的拓扑结构,但是使用者应该足够聪明,并独立于顺序提供一致的结果。所以这绝对是一个实现错误。
顺便说一句,XML规范规定
开始标记中属性规范的顺序不重要
https://stackoverflow.com/questions/3037780
复制相似问题