Skip to content

The struct have conflict path when a tag have both subtag and attribute. #2

Open

Description

@wicast

xml like this

<?xml version="1.0" encoding="utf-8"?>
<root>
    <channel id="1">
         <item></item>
         <item></item>
        <item></item>
   </channel>
</root>

will get structs like that

type Root struct {
    Channel Channel `xml:"channel"`
    Item    []string    `xml:"channel>item"`
}

type Channel struct {
    Id  string  `xml:"id,attr"`
}

This one have a conflict path,the correct from should be

type Root struct {
    Channel Channel `xml:"channel"`
}

type Channel struct {
    Id  string  `xml:"id,attr"`
    Item    []string    `xml:"item"`
}

Remove the conflict is a tough job with current data struct.

So I'm working a new version that can handle both nesting style and non-nesting style(without conflict).

Activity

  1. RobbieMcKinstry commented on Mar 31, 2017

    @RobbieMcKinstry

    Hi! Any progress on this bug?
    As far as I can tell, this project is the only reliable XML-to-Go struct generator I can find that produces reasonable output. So if you're blocked on this and need help, let me know and I'll see if I can help @wicast :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址