views:

46

answers:

1

Is the order of attributes in a certain tag releveant. Specific case:

This is from a selenium testfile. Given a testcasse

<?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"&gt;
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="selenium.base" href="http://10.9.10.100"/&gt;
<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>

The line of interest is this:

<link rel="selenium.base" href="http://10.9.10.100"/&gt;

When specified as above, it will correctly be parsed by the fixed version of Selenium IDE software. However when I switch the two arguments:

<link  href="http://10.9.10.100" rel="selenium.base"/>

Selenium IDE won't parse the href attribute correctly.

I always though the order of attributes didn't matter. Am I wrong or is this an implementation error?

+4  A: 

When you are parsing an XML file, attributes are (usually) put in the document tree in a left to right order (depending on the implementation). So, in the real world the order somehow affects the topology of the tree, however the consumer should be smart enough and provide consistent results independently of the order. So this is definitely an implementation error.

By the way, the XML specification states that

the order of attribute specifications in a start-tag is not significant

Lorenzo