Closed decathorpe closed 1 year ago
@bahlo You seem to have more experience with weird XML-RPC clients / servers than me - do you think it would be an issue if dxr clients / servers started sending XML-RPC messages that contained self-closing XML tags for empty strings / bytes?
Correction: quick-xml seems to write <string/>
and <base64/>
without a space before />
. It looks weird to me for some reason, but it appears to be valid XML 1.0 syntax.
EDIT: https://github.com/ironthree/dxr/commit/407a3a189c7afdfab1354decf95712917f11a999 is how far I've gotten. I needed to adapt some tests for the behaviour change, but everything else still seems to work.
Hah yeah I sadly do—the server I‘m interfacing with is using XMLRPC++ 0.7
and does not support self-closing xml tags so I‘d selfishly advise to not use that feature 🥸
For some reason I suspected as much 😓 I opened an issue with quick-xml upstream, maybe this can be worked around somehow: https://github.com/tafia/quick-xml/issues/617
quick-xml v0.30 was released with the new API.
This commit updates the dependency and adjusts the code accordingly: https://github.com/ironthree/dxr/commit/ee8799856d2eebbaad81167ccbf92c22a542bd30
Will be part of the upcoming (soon!) v0.6.0 release.
appreciate it!
The quick-xml dependency is currently pinned to v0.25, while upstream has already released v0.29. However, I'm not sure how to handle some of the breaking changes since v0.25:
$text
attribute (added in v0.28.0) breaks the new customValue
deserializer (though adding a case for"$text"
to thematch
statement seems to solve that (not sure if that's correct, but it seems to work 😕)<value><string /></value>
and empty bytes are written as<value><base64 /></value>
. While this is valid XML and should be acceptable for XML-RPC, it's inconsistent with other implementationsI've checked how Python's xmlrpc module handles this (see below) - it supports reading XML with self-closing tags, but it does not seem to ever write them. I don't think there's a way to control this behaviour from the quick-xml serializer side (without writing a custom serializer ...)