-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialize unconsistent XML to a normalized Array #188
Comments
To achieve this, you will also need a custom deserializer for |
Hi, Thanks for your response. I've tried making a custom deserializer for I thought about using classes too, but it looks like overcomplicating things to just parse a simple request. Best, |
Hi @evert, As per your suggestion, I've switched to classes and, since I also intend write XML responses, I've decided to go all in and make a full blown library (its purpose is to handle updating pricing and availability in the Google Hotel Ads service): https://github.com/bahiazul/google-hotel-ads-xml However, I'm in a similar situation as before:
I've added an For more info, all element classes inherit from a There is also a What am I doing wrong? I've read the docs and the source code from top to bottom and I still can't figure it out. Any help would be appreciated. Best, |
I think in the case of It looks like that's an issue at at least a couple of places, so start there |
Thanks @evert , I've made the modifications that you suggested but unfortunately I haven't seen any changes. However, I've observed that, when turning off mapping to Sadly this puts me in the same situation as before switching to classes. On the bright side, I now know where the problems exactly are. I just need to find how to fix them 😅. Best, |
Hi,
I have this weird looking XML and I'm trying to convert it to a simple array.
So far I've managed to do most of it with
keyValue
andrepeatingElements
deserializers and a custom one for the<Child/>
element.My problem is with the
<Context/>
elements. Since they aren't wrapped in a parent element, I can't treat them like repeating elements and if I parse<Query/>
’s children like key-value elements, I only get the first<Context/>
element.Any suggestions?
This an example of the XML that I'm trying to parse:
And this is the result that I would like to achieve:
Best,
Javier.
The text was updated successfully, but these errors were encountered: