Ordering of REXML::XPath#match result

A

Alexey Verkhovsky

I'm using REXML::XPath for testing of XHTML contents, and in some cases
I have to sort the results of a match, because it doesn't come out in
the same order as it appears in the document. I haven't found anything
about it in the RDoc.

Is there no guarantee about the ordering, or am I missing something?

E.g., REXML::XPath.match(xml, '//input') produces <input/> tags in a
different order from how it is in the form.

<form action="/topic/show/1#postform" method="post">
<input type="hidden" name="dummy" value="ie-workaround" />
<!-- TODO remove this -->
<input type="hidden" name="reply_to" value="1001" />
Parent_id:<br />
<input id="post_parent_id" name="post[parent_id]" size="30" type="hidden" value="1001" /><br />
Topic_id:<br />
<input id="post_topic_id" name="post[topic_id]" size="30" type="hidden" value="1" /><br />
Name:<br />
<input id="post_guest_name" name="post[guest_name]" size="30" type="text" value="" /><br />
Email:<br />
<input id="post_guest_email" name="post[guest_email]" size="30" type="text" value="" /><br />
Subject:<br />
<input id="post_subject" name="post[subject]" size="30" type="text" value="Re: B2" /><br />
Text:<br />
<textarea cols="80" id="post_text" name="post[text]" rows="24" wrap="virtual">Alex wrote:
&gt; (unknown) wrote:
&gt;&gt; xyz

</textarea><br />
<input type="submit" name="submit" value="Submit" />
</form>

Best regards,
Alexey Verkhovsky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top