Parsing to dictionaries #248
Unanswered
JaapWijnen
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Hi @JaapWijnen! I converted this to a discussion since we use issues for bug tracking. Can you share more of your use case? It sounds like you're parsing a substring/bytes into an |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I've been doing some xml related parsing recently and I run into an issue when parsing attributes such as:
<xmlTag "attr1"="value1" "attr2"="value2" />
When parsing these to a dictionary round tripping wil occasionally fail since dictionaries are unordered so the printed order will be reversed for example.
So I switched to swift-collections'
OrderedDictionary
which fixed the problem.A few of swift-collections' types don't conform to collection however due to protocol requirement clashes with subscripts I believe.
Specifically the
End()
parser requires Input to conform to Collection. Summarising I have two questions:End
parser to Sequence?Something like this seems to work in this case:
Let me know what you think!
Beta Was this translation helpful? Give feedback.
All reactions