off-topic

2026-02-09T16:55:56.972049Z

this isn't quite related to clojure, so i'm asking here: is it legal for an xml document to have multiple <?xml version="1.1"?> declarations? the data.xml parser doesn't care (uses the first one) but i don't want to rely on undefined or bad behavior

✅ 1
Ludger Solbach 2026-02-09T17:02:05.874049Z

I'm not sure if it's illegal, but it does not make sense.

2026-02-09T17:06:28.997049Z

lol true. we're getting xml fragments from a third party that contain characters only legal in version 1.1, but not every fragment contains the version part. i tried prepending <?xml version="1.1"?> to all of the strings we're parsing, and that's worked so far but it makes me nervous. i'd prefer to avoid using a try/catch, as that can be costly for performance and we're crunching a fair amount.

Ludger Solbach 2026-02-09T17:10:43.420419Z

<? ?> are technically processing instructions, IIRC. If so, you may have any numbers of these.

2026-02-09T17:15:44.509319Z

ah great, thank you

2026-02-09T17:16:38.903989Z

"processing instructions" has led me to the right spot in the spec, i think i can figure it out from here

👍 1