Skip to content
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

Decode special XML Structure #156

Closed
alexllao opened this issue Dec 12, 2019 · 2 comments
Closed

Decode special XML Structure #156

alexllao opened this issue Dec 12, 2019 · 2 comments
Assignees
Labels
more info needed Not enough details available to proceed

Comments

@alexllao
Copy link

alexllao commented Dec 12, 2019

Hi!

How can I decode such an xml? All server responses always come with the structure

<response>
<values>
....
</values>
</response>

Example XML:

<?xml version="1.0" encoding="utf-8"?>
<response>
  <values>
    <id>34343434343</id>
    <alias>Lorem</alias>
    <stealth>0</stealth>
    <mailing_accept>0</mailing_accept>
    <email>assdaasdd@gmail.com</email>
    <avatar>https://lh3.googleusercontent.com/a-/dsaasdsdasdasdas</avatar>
    <number_of_tests>56</number_of_tests>
    <points>-1</points>
    <average_score>1.33</average_score>
    <premium>1</premium>
  </values>
  <result>1</result>
  <timeout>31</timeout>
</response>

Thnks a lot!

@MaxDesiatov
Copy link
Collaborator

Hi @alexllao, sorry for the delayed reply.

Do you know the element names within the <values> tag upfront? You could decode that either as a struct with names of properties matching the names of contained elements (which is beneficial as you'd specify value types as well) or as a dictionary or an enum if combinations of nested elements can vary significantly. Which of these options would work best for you and what help would you need to implement that?

@MaxDesiatov MaxDesiatov added the more info needed Not enough details available to proceed label Dec 25, 2019
@MaxDesiatov
Copy link
Collaborator

Unfortunately, I'm not able to proceed with this issue without more details, and it hasn't been updated for quite a while. Please feel free to reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed Not enough details available to proceed
Projects
None yet
Development

No branches or pull requests

2 participants