serde-xml-rs icon indicating copy to clipboard operation
serde-xml-rs copied to clipboard

Help deserialising alternating pairs

Open woelper opened this issue 3 years ago • 0 comments

Hi! I am trying to deserialise xml from Texturepacker - It's in rather unusual format that uses some markup like this:

<key>name</key>
<customtype>value</customtype>
<key>name2</key>
<customtype>value2</customtype>

I read the docs and looked at the tests, but I could not figure out a way to do that. Maybe this is outside the scope of this crate, but is there any functionality available to make this easier?

Example:

<data version="1.0">
    <struct type="Settings">
        <key>fileFormatVersion</key>
        <int>4</int>
        <key>texturePackerVersion</key>
        <string>4.8.2</string>
        <key>autoSDSettings</key>
        <array>
            <struct type="AutoSDSettings">
                <key>scale</key>
                <double>1</double>
                <key>extension</key>
                <string />
                <key>spriteFilter</key>
                <string />
                <key>acceptFractionalValues</key>
                <false />
                <key>maxTextureSize</key>
                <QSize>
                    <key>width</key>
                    <int>-1</int>
                    <key>height</key>
                    <int>-1</int>
                </QSize>
            </struct>
        </array>
        <key>allowRotation</key>
        <true />
        <key>shapeDebug</key>
        <false />

woelper avatar May 27 '21 12:05 woelper