Skip to content

Possible to force array? #23

@gbminnock

Description

@gbminnock

Hi, is it possible for force an array? For example i have the following xml:

<?xml version="1.0" encoding="UTF-8"?>
<rss>
    <channel>
        <item>
            <apps>
                <app>App One</app>
            </apps>
        </item>
        <item>
            <apps>
                <app>App Two</app>
                <app>App Three</app>
            </apps>
        </item>
    </channel>
</rss>

which converts to

{
  "rss": {
    "channel": {
      "item": [
        { "apps": { "app": "App One" } },
        { "apps": { "app": ["App Two", "App Three"] } }
      ]
    }
  }
}

The problem is that the Apps/app node is an object but the second & third Apps/app node is an array. I understand why given the structure, but is it possible to force the first node to also be an array?
Tks,
Gary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions