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

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

Open
wicast opened this issue Nov 6, 2015 · 1 comment
Labels

Comments

@wicast
Copy link
Owner

wicast commented Nov 6, 2015

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).

@wicast wicast added the bug label Nov 6, 2015
@RobbieMcKinstry
Copy link

RobbieMcKinstry commented Mar 31, 2017

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants