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

Implement sparse/keyed array support #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

q3k
Copy link

@q3k q3k commented Feb 25, 2023

The following is a valid plist XML:

<array>
    <key>100</key>
    <string>foo</string>
    <key>200</key>
    <string>bar</string>
</array>

This enables parsing such arrays to dictionaries, which can in turn be unmarshaled to Go maps, similarly to elements.

This isn't great, as ideally keys should be integers, and order should be preserved - but at least it allows for some kind of parse.

The following is a valid plist XML:

    <array>
        <key>100</key>
        <string>foo</string>
        <key>200</key>
        <string>bar</string>
    </array>

This enables parsing such arrays to dictionaries, which can in turn be
unmarshaled to Go maps, similarly to <dict> elements.

This isn't great, as ideally keys should be integers, and order should
be preserved - but at least it allows for some kind of parse.
@DHowett
Copy link
Owner

DHowett commented Feb 25, 2023

Hey, thanks for the contribution! Do you have any information on when this became supported in NSPropertyListSerialization? Do you know if a construction like this is supported in any of the non-XML formats?

@q3k
Copy link
Author

q3k commented Feb 25, 2023

Nope. I just got a plist in this shape from an iPod that I'm hacking on: https://object.ceph-eu.hswaw.net/q3k-personal/079c8917f97c55a76937cb7f5dc6d37b4f71f2e1775011af5c4bbffbf05f191b.xml

All I know is that plutil -lint says it's indeed okay. This totally is not my area of expertise. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants