Make query xml return nodes in document order (#13047)

# Description

`query xml` used to return results from an XPath query in a random,
non-deterministic order. With this change, results get returned in the
order they appear in the document.

# User-Facing Changes
`query xml` will now return results in a non-random order.

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
This commit is contained in:
Antoine Büsch 2024-06-05 11:47:36 +10:00 committed by GitHub
parent c310175a1e
commit d4fa014534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,7 +88,7 @@ pub fn execute_xpath_query(
match r {
sxd_xpath::Value::Nodeset(ns) => {
for n in ns.into_iter() {
for n in ns.document_order() {
record.push(key.clone(), Value::string(n.string_value(), call.head));
}
}