FAQ
I need to have go Structs from a XML to be able to use this and change the
values. It's a big XML.

Actually, this XML response here
-> http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

Do anybody know any easy way to write this XML structure to a Go struct?

I don't think it's the best to do this by hand. Because of the time to do
it and the many possibilities of mistakes. So i decided to ask you.

Let me know if I'm lacking on explanation of the problem.

Thank you!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Miki Tebeka at Feb 9, 2014 at 5:00 pm
    In what way does the xml package<http://golang.org/pkg/encoding/xml/#example_Unmarshal>come short?
    On Sunday, February 9, 2014 7:47:05 AM UTC-8, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Josh Bleecher Snyder at Feb 9, 2014 at 5:32 pm
    I think Marco is looking for something like
    https://github.com/bashtian/jsonutils for xml. Sorry, Marco, I don't
    know of any, but perhaps you could modify jsonutils to suit your
    purposes (and open source it?).

    -josh

    On Sun, Feb 9, 2014 at 9:00 AM, Miki Tebeka wrote:
    In what way does the xml package come short?

    On Sunday, February 9, 2014 7:47:05 AM UTC-8, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Marco TNP at Feb 9, 2014 at 5:52 pm
    Yes, Josh. Tha's the kind of thing I'm looking for.

    I'll see what I can do with this jsonutils and if I'm able to make
    something useful for XML out of it, I'll post the link to my fork here in
    the post.

    Thank you!

    Em domingo, 9 de fevereiro de 2014 15h31min38s UTC-2, Josh Bleecher Snyder
    escreveu:
    I think Marco is looking for something like
    https://github.com/bashtian/jsonutils for xml. Sorry, Marco, I don't
    know of any, but perhaps you could modify jsonutils to suit your
    purposes (and open source it?).

    -josh

    On Sun, Feb 9, 2014 at 9:00 AM, Miki Tebeka wrote:
    In what way does the xml package come short?

    On Sunday, February 9, 2014 7:47:05 AM UTC-8, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change
    the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html
    Do anybody know any easy way to write this XML structure to a Go
    struct?
    I don't think it's the best to do this by hand. Because of the time to
    do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Simon place at Feb 10, 2014 at 7:45 pm
    well, it would be nice if there was a utility that could take xsl and make
    a go file containing the struct's needed to read it.

    On Sunday, 9 February 2014 17:00:23 UTC, Miki Tebeka wrote:

    In what way does the xml package<http://golang.org/pkg/encoding/xml/#example_Unmarshal>come short?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • C Banning at Feb 11, 2014 at 12:34 pm
    The problem is not trivial and requires some judgement, such as identical
    tag labels embedded in complex elements, etc.

    But I hacked together some pieces from github.com/clbanning/mxj and
    github.com/clbanning/x2j that'll get you started with the referenced
    example for this thread: http://play.golang.org/p/FDKbWpwPx8.

    That should jump start your editing - or you can extend it to generate
    proto-structure definitions.
    On Monday, February 10, 2014 1:44:40 PM UTC-6, simon place wrote:

    well, it would be nice if there was a utility that could take xsl and make
    a go file containing the struct's needed to read it.

    On Sunday, 9 February 2014 17:00:23 UTC, Miki Tebeka wrote:

    In what way does the xml package<http://golang.org/pkg/encoding/xml/#example_Unmarshal>come short?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Simon place at Feb 11, 2014 at 9:23 pm
    checking around i found a link to AWS cloud front schema on this page;

    http://docs.aws.amazon.com/AmazonCloudFront/2010-11-01/APIReference/Welcome.html?r=8751

    but the link is broken!

    doing some more poking around it looks like xsd schema have generally been
    given up on, they did always seem a bit broken IMHO, but they dont seem to
    have been replaced by anything, which seems a bit strange.

    On Monday, 10 February 2014 19:44:40 UTC, simon place wrote:

    well, it would be nice if there was a utility that could take xsl and make
    a go file containing the struct's needed to read it.

    On Sunday, 9 February 2014 17:00:23 UTC, Miki Tebeka wrote:

    In what way does the xml package<http://golang.org/pkg/encoding/xml/#example_Unmarshal>come short?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Marco TNP at Feb 9, 2014 at 5:55 pm
    Thank you, guys, for answering.
    I'm still looking for alternatives while I'm also writing the struct by
    hand.. what I think is just too problematic. But the job has to be done
    somehow.. haha

    Also checking this jsonutils to see what I can do because that is the kind
    of transformation I intend to do in a fast way.

    Em domingo, 9 de fevereiro de 2014 13h47min05s UTC-2, Marco TNP escreveu:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andrey mirtchovski at Feb 9, 2014 at 6:40 pm
    if Amazon's services are your use case why not take a look at how the
    goamz package solves the problem?

    http://bazaar.launchpad.net/~goamz/goamz/trunk/files

    I don't think it does ACF but that shouldn't be hard to add.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rjeczalik at Feb 9, 2014 at 7:55 pm
    You have couple of options:

    1) use launchpad.net/xmlpath for XPATH-like access to your XML document
    2) there should be somewhere Go-binding for Nokogiri, you could then
    parse your XML doc in DOM-like style (it requires CGO though)
    3) there is also code.google.com/p/go.net/html, with which I believe
    you could get the same as #2
    4) instead of unmashaling into struct write your own tokenizer with
    http://golang.org/pkg/encoding/xml/#Decoder.Token to extract the data
    you need.
    On 9 February 2014 18:54, Marco TNP wrote:
    Thank you, guys, for answering.
    I'm still looking for alternatives while I'm also writing the struct by
    hand.. what I think is just too problematic. But the job has to be done
    somehow.. haha

    Also checking this jsonutils to see what I can do because that is the kind
    of transformation I intend to do in a fast way.

    Em domingo, 9 de fevereiro de 2014 13h47min05s UTC-2, Marco TNP escreveu:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rjeczalik at Feb 9, 2014 at 7:55 pm

    On 9 February 2014 19:27, rjeczalik wrote:
    You have couple of options:
    Ah, ignore my comment, I missed the part where you mentioned you want
    to rewrite the XML tree. What about the
    https://github.com/clbanning/mxj?

    e.g. http://play.golang.org/p/x_nEpB4rs8
    1) use launchpad.net/xmlpath for XPATH-like access to your XML document
    2) there should be somewhere Go-binding for Nokogiri, you could then
    parse your XML doc in DOM-like style (it requires CGO though)
    3) there is also code.google.com/p/go.net/html, with which I believe
    you could get the same as #2
    4) instead of unmashaling into struct write your own tokenizer with
    http://golang.org/pkg/encoding/xml/#Decoder.Token to extract the data
    you need.
    On 9 February 2014 18:54, Marco TNP wrote:
    Thank you, guys, for answering.
    I'm still looking for alternatives while I'm also writing the struct by
    hand.. what I think is just too problematic. But the job has to be done
    somehow.. haha

    Also checking this jsonutils to see what I can do because that is the kind
    of transformation I intend to do in a fast way.

    Em domingo, 9 de fevereiro de 2014 13h47min05s UTC-2, Marco TNP escreveu:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • C Banning at Feb 10, 2014 at 12:39 pm
    Some in the past have used http://godoc.org/github.com/clbanning/x2j which
    has recently been refactored to http://godoc.org/github.com/clbanning/mxj.
    On Sunday, February 9, 2014 9:47:05 AM UTC-6, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Marco TNP at Feb 12, 2014 at 2:18 am
    Hey again. I made all the structs by hand. That's okay for now, but now I'm
    curious to look for or make a solution for this kind of work.

    Thank you for all the suggestions, they were all helpful even the ones I
    had already checked myself because I could know that I was not searching
    non-sense haha

    I used the C Banning code using x2j and mxj (and changed it a bit) after I
    had written the structs to have a look and check if I had them divided the
    right way.

    Em domingo, 9 de fevereiro de 2014 13h47min05s UTC-2, Marco TNP escreveu:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Glen Newton at Aug 27, 2014 at 4:40 pm
    BTW, the XML at
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html
    <http://www.google.com/url?q=http%3A%2F%2Fdocs.aws.amazon.com%2FAmazonCloudFront%2Flatest%2FAPIReference%2FGetDistribution.html&sa=D&sntz=1&usg=AFQjCNFEkCthDRIDl4OvknPJdRLLqQ4jRw>
    does not validate when pasted in to:
    http://validator.w3.org/#validate_by_input

    It has a number of improperly closed tags, and comments that start with <--
    instead of <!--

    Validation Output: 8 Errors

        1. [image: Error] *Line 86 <http://validator.w3.org/check#line-86>,
        Column 22*: end tag for "Items" omitted, but OMITTAG NO was specified

                    </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         2. [image: Info] *Line 85 <http://validator.w3.org/check#line-85>,
        Column 16*: start tag was here

                       *<*Items>

        3. [image: Error] *Line 86 <http://validator.w3.org/check#line-86>,
        Column 22*: end tag for "Items" omitted, but OMITTAG NO was specified

                    </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         4. [image: Info] *Line 83 <http://validator.w3.org/check#line-83>,
        Column 16*: start tag was here

                       *<*Items>

        5. [image: Error] *Line 86 <http://validator.w3.org/check#line-86>,
        Column 22*: end tag for "Quantity" omitted, but OMITTAG NO was specified

                    </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         6. [image: Info] *Line 82 <http://validator.w3.org/check#line-82>,
        Column 64*: start tag was here

                       <Quantity>number of headers to forward to origin*<*Quantity>

        7. [image: Error] *Line 86 <http://validator.w3.org/check#line-86>,
        Column 22*: end tag for "Quantity" omitted, but OMITTAG NO was specified

                    </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         8. [image: Info] *Line 82 <http://validator.w3.org/check#line-82>,
        Column 16*: start tag was here

                       *<*Quantity>number of headers to forward to origin<Quantity>

        9. [image: Warning] *Line 103 <http://validator.w3.org/check#line-103>,
        Column 16*: character "<" is the first character of a delimiter but
        occurred as data

                       *<*-- If you only want to use CloudFront to serve your content

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=404#errormsg>

        This message may appear in several cases:
        - You tried to include the "<" character in your page: you should escape
           it as "&lt;"
           - You used an unescaped ampersand "&": this may be valid in some
           contexts, but it is recommended to use "&amp;", which is always safe.
           - Another possibility is that you forgot to close quotes in a
           previous tag.
         10. [image: Warning] *Line 107
        <http://validator.w3.org/check#line-107>, Column 16*: character "<" is
        the first character of a delimiter but occurred as data

                       *<*-- If you want to use any methods in addition to

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=404#errormsg>

        This message may appear in several cases:
        - You tried to include the "<" character in your page: you should escape
           it as "&lt;"
           - You used an unescaped ampersand "&": this may be valid in some
           contexts, but it is recommended to use "&amp;", which is always safe.
           - Another possibility is that you forgot to close quotes in a
           previous tag.
         11. [image: Error] *Line 149 <http://validator.w3.org/check#line-149>,
        Column 28*: end tag for "Items" omitted, but OMITTAG NO was specified

                          </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         12. [image: Info] *Line 148 <http://validator.w3.org/check#line-148>,
        Column 22*: start tag was here

                             *<*Items>

        13. [image: Error] *Line 149 <http://validator.w3.org/check#line-149>,
        Column 28*: end tag for "Items" omitted, but OMITTAG NO was specified

                          </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         14. [image: Info] *Line 146 <http://validator.w3.org/check#line-146>,
        Column 22*: start tag was here

                             *<*Items>

        15. [image: Error] *Line 149 <http://validator.w3.org/check#line-149>,
        Column 28*: end tag for "Quantity" omitted, but OMITTAG NO was specified

                          </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         16. [image: Info] *Line 145 <http://validator.w3.org/check#line-145>,
        Column 70*: start tag was here

                             <Quantity>number of headers to forward to origin*<*Quantity>

        17. [image: Error] *Line 149 <http://validator.w3.org/check#line-149>,
        Column 28*: end tag for "Quantity" omitted, but OMITTAG NO was specified

                          </Headers*>*

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=70#errormsg>

        You may have neglected to close an element, or perhaps you meant to
        "self-close" an element, that is, ending it with "/>" instead of ">".
         18. [image: Info] *Line 145 <http://validator.w3.org/check#line-145>,
        Column 22*: start tag was here

                             *<*Quantity>number of headers to forward to origin<Quantity>

        19. [image: Warning] *Line 167 <http://validator.w3.org/check#line-167>,
        Column 22*: character "<" is the first character of a delimiter but
        occurred as data

                             *<*-- If you only want to use CloudFront to serve your

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=404#errormsg>

        This message may appear in several cases:
        - You tried to include the "<" character in your page: you should escape
           it as "&lt;"
           - You used an unescaped ampersand "&": this may be valid in some
           contexts, but it is recommended to use "&amp;", which is always safe.
           - Another possibility is that you forgot to close quotes in a
           previous tag.
         20. [image: Warning] *Line 172
        <http://validator.w3.org/check#line-172>, Column 22*: character "<" is
        the first character of a delimiter but occurred as data

                             *<*-- If you want to use any methods in addition to

         ✉ <http://validator.w3.org/feedback.html?uri=;errmsg_id=404#errormsg>

        This message may appear in several cases:
        - You tried to include the "<" character in your page: you should escape
           it as "&lt;"
           - You used an unescaped ampersand "&": this may be valid in some
           contexts, but it is recommended to use "&amp;", which is always safe.
           - Another possibility is that you forgot to close quotes in a
           previous tag.


    On Sunday, February 9, 2014 10:47:05 AM UTC-5, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Leonid Ganeline at Aug 27, 2014 at 10:16 pm
    I would suggest to use some XML to JSON transformer, like JSON.net, then
    JSON to Golang would be much easier.
    On Sunday, 9 February 2014 07:47:05 UTC-8, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Glen Newton at Aug 28, 2014 at 11:47 am
    try chidley: https://github.com/gnewton/chidley

    Go structs from your amaxon example:
    type Chi_root struct {
         Chi_Distribution *Chi_Distribution
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Distribution,omitempty" json:"Distribution,omitempty"`
    }

    type Chi_Distribution struct {
         Attr_xmlns string `xml:" xmlns,attr" json:",omitempty"`
         Chi_ActiveTrustedSigners *Chi_ActiveTrustedSigners
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ActiveTrustedSigners,omitempty" json:"ActiveTrustedSigners,omitempty"`
         Chi_DistributionConfig *Chi_DistributionConfig
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DistributionConfig,omitempty" json:"DistributionConfig,omitempty"`
         Chi_DomainName *Chi_DomainName
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ DomainName,omitempty"
    json:"DomainName,omitempty"`
         Chi_Id *Chi_Id `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Id,omitempty" json:"Id,omitempty"`
         Chi_InProgressInvalidationBatches *Chi_InProgressInvalidationBatches
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    InProgressInvalidationBatches,omitempty"
    json:"InProgressInvalidationBatches,omitempty"`
         Chi_LastModifiedTime *Chi_LastModifiedTime
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    LastModifiedTime,omitempty" json:"LastModifiedTime,omitempty"`
         Chi_Status *Chi_Status
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Status,omitempty"
    json:"Status,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Distribution,omitempty" json:"Distribution,omitempty"`
    }

    type Chi_DomainName struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DomainName,omitempty" json:"DomainName,omitempty"`
    }

    type Chi_ActiveTrustedSigners struct {
         Chi_Enabled *Chi_Enabled
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Enabled,omitempty"
    json:"Enabled,omitempty"`
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ActiveTrustedSigners,omitempty" json:"ActiveTrustedSigners,omitempty"`
    }

    type Chi_Enabled struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Enabled,omitempty" json:"Enabled,omitempty"`
    }

    type Chi_Quantity struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Quantity,omitempty" json:"Quantity,omitempty"`
    }

    type Chi_Items struct {
         Chi_AwsAccountNumber *Chi_AwsAccountNumber
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AwsAccountNumber,omitempty" json:"AwsAccountNumber,omitempty"`
         Chi_CNAME *Chi_CNAME
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ CNAME,omitempty"
    json:"CNAME,omitempty"`
         Chi_CacheBehavior *Chi_CacheBehavior
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CacheBehavior,omitempty" json:"CacheBehavior,omitempty"`
         Chi_CustomErrorResponse *Chi_CustomErrorResponse
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomErrorResponse,omitempty" json:"CustomErrorResponse,omitempty"`
         Chi_KeyPairId *Chi_KeyPairId
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ KeyPairId,omitempty"
    json:"KeyPairId,omitempty"`
         Chi_Location *Chi_Location
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Location,omitempty"
    json:"Location,omitempty"`
         Chi_Method []*Chi_Method
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Method,omitempty"
    json:"Method,omitempty"`
         Chi_Name *Chi_Name
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Name,omitempty"
    json:"Name,omitempty"`
         Chi_Origin *Chi_Origin
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Origin,omitempty"
    json:"Origin,omitempty"`
         Chi_Signer *Chi_Signer
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Signer,omitempty"
    json:"Signer,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Items,omitempty" json:"Items,omitempty"`
    }

    type Chi_Signer struct {
         Chi_AwsAccountNumber *Chi_AwsAccountNumber
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AwsAccountNumber,omitempty" json:"AwsAccountNumber,omitempty"`
         Chi_KeyPairIds *Chi_KeyPairIds
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ KeyPairIds,omitempty"
    json:"KeyPairIds,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Signer,omitempty" json:"Signer,omitempty"`
    }

    type Chi_AwsAccountNumber struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AwsAccountNumber,omitempty" json:"AwsAccountNumber,omitempty"`
    }

    type Chi_KeyPairIds struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    KeyPairIds,omitempty" json:"KeyPairIds,omitempty"`
    }

    type Chi_CNAME struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CNAME,omitempty" json:"CNAME,omitempty"`
    }

    type Chi_CustomErrorResponse struct {
         Chi_ErrorCachingMinTTL *Chi_ErrorCachingMinTTL
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ErrorCachingMinTTL,omitempty" json:"ErrorCachingMinTTL,omitempty"`
         Chi_ErrorCode *Chi_ErrorCode
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ ErrorCode,omitempty"
    json:"ErrorCode,omitempty"`
         Chi_ResponseCode *Chi_ResponseCode
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ResponseCode,omitempty" json:"ResponseCode,omitempty"`
         Chi_ResponsePagePath *Chi_ResponsePagePath
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ResponsePagePath,omitempty" json:"ResponsePagePath,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomErrorResponse,omitempty" json:"CustomErrorResponse,omitempty"`
    }

    type Chi_ErrorCode struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ErrorCode,omitempty" json:"ErrorCode,omitempty"`
    }

    type Chi_ResponsePagePath struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ResponsePagePath,omitempty" json:"ResponsePagePath,omitempty"`
    }

    type Chi_ResponseCode struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ResponseCode,omitempty" json:"ResponseCode,omitempty"`
    }

    type Chi_ErrorCachingMinTTL struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ErrorCachingMinTTL,omitempty" json:"ErrorCachingMinTTL,omitempty"`
    }

    type Chi_Location struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Location,omitempty" json:"Location,omitempty"`
    }

    type Chi_KeyPairId struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    KeyPairId,omitempty" json:"KeyPairId,omitempty"`
    }

    type Chi_Origin struct {
         Chi_CustomOriginConfig *Chi_CustomOriginConfig
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomOriginConfig,omitempty" json:"CustomOriginConfig,omitempty"`
         Chi_DomainName *Chi_DomainName
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ DomainName,omitempty"
    json:"DomainName,omitempty"`
         Chi_Id *Chi_Id `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Id,omitempty" json:"Id,omitempty"`
         Chi_S3OriginConfig *Chi_S3OriginConfig
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    S3OriginConfig,omitempty" json:"S3OriginConfig,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Origin,omitempty" json:"Origin,omitempty"`
    }

    type Chi_Id struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Id,omitempty" json:"Id,omitempty"`
    }

    type Chi_S3OriginConfig struct {
         Chi_OriginAccessIdentity *Chi_OriginAccessIdentity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    OriginAccessIdentity,omitempty" json:"OriginAccessIdentity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    S3OriginConfig,omitempty" json:"S3OriginConfig,omitempty"`
    }

    type Chi_OriginAccessIdentity struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    OriginAccessIdentity,omitempty" json:"OriginAccessIdentity,omitempty"`
    }

    type Chi_CustomOriginConfig struct {
         Chi_HTTPPort *Chi_HTTPPort
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ HTTPPort,omitempty"
    json:"HTTPPort,omitempty"`
         Chi_HTTPSPort *Chi_HTTPSPort
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ HTTPSPort,omitempty"
    json:"HTTPSPort,omitempty"`
         Chi_OriginProtocolPolicy *Chi_OriginProtocolPolicy
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    OriginProtocolPolicy,omitempty" json:"OriginProtocolPolicy,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomOriginConfig,omitempty" json:"CustomOriginConfig,omitempty"`
    }

    type Chi_HTTPPort struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    HTTPPort,omitempty" json:"HTTPPort,omitempty"`
    }

    type Chi_HTTPSPort struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    HTTPSPort,omitempty" json:"HTTPSPort,omitempty"`
    }

    type Chi_OriginProtocolPolicy struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    OriginProtocolPolicy,omitempty" json:"OriginProtocolPolicy,omitempty"`
    }

    type Chi_Name struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Name,omitempty" json:"Name,omitempty"`
    }

    type Chi_Method struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Method,omitempty" json:"Method,omitempty"`
    }

    type Chi_CacheBehavior struct {
         Chi_AllowedMethods *Chi_AllowedMethods
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AllowedMethods,omitempty" json:"AllowedMethods,omitempty"`
         Chi_ForwardedValues *Chi_ForwardedValues
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ForwardedValues,omitempty" json:"ForwardedValues,omitempty"`
         Chi_MinTTL *Chi_MinTTL
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ MinTTL,omitempty"
    json:"MinTTL,omitempty"`
         Chi_PathPattern *Chi_PathPattern
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    PathPattern,omitempty" json:"PathPattern,omitempty"`
         Chi_SmoothStreaming *Chi_SmoothStreaming
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    SmoothStreaming,omitempty" json:"SmoothStreaming,omitempty"`
         Chi_TargetOriginId *Chi_TargetOriginId
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TargetOriginId,omitempty" json:"TargetOriginId,omitempty"`
         Chi_TrustedSigners *Chi_TrustedSigners
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TrustedSigners,omitempty" json:"TrustedSigners,omitempty"`
         Chi_ViewerProtocolPolicy *Chi_ViewerProtocolPolicy
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ViewerProtocolPolicy,omitempty" json:"ViewerProtocolPolicy,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CacheBehavior,omitempty" json:"CacheBehavior,omitempty"`
    }

    type Chi_SmoothStreaming struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    SmoothStreaming,omitempty" json:"SmoothStreaming,omitempty"`
    }

    type Chi_PathPattern struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    PathPattern,omitempty" json:"PathPattern,omitempty"`
    }

    type Chi_TargetOriginId struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TargetOriginId,omitempty" json:"TargetOriginId,omitempty"`
    }

    type Chi_ForwardedValues struct {
         Chi_Cookies *Chi_Cookies
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Cookies,omitempty"
    json:"Cookies,omitempty"`
         Chi_Headers *Chi_Headers
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Headers,omitempty"
    json:"Headers,omitempty"`
         Chi_QueryString *Chi_QueryString
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    QueryString,omitempty" json:"QueryString,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ForwardedValues,omitempty" json:"ForwardedValues,omitempty"`
    }

    type Chi_QueryString struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    QueryString,omitempty" json:"QueryString,omitempty"`
    }

    type Chi_Cookies struct {
         Chi_Forward *Chi_Forward
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Forward,omitempty"
    json:"Forward,omitempty"`
         Chi_WhitelistedNames *Chi_WhitelistedNames
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    WhitelistedNames,omitempty" json:"WhitelistedNames,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Cookies,omitempty" json:"Cookies,omitempty"`
    }

    type Chi_Forward struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Forward,omitempty" json:"Forward,omitempty"`
    }

    type Chi_WhitelistedNames struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    WhitelistedNames,omitempty" json:"WhitelistedNames,omitempty"`
    }

    type Chi_Headers struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Headers,omitempty" json:"Headers,omitempty"`
    }

    type Chi_TrustedSigners struct {
         Chi_Enabled *Chi_Enabled
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Enabled,omitempty"
    json:"Enabled,omitempty"`
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TrustedSigners,omitempty" json:"TrustedSigners,omitempty"`
    }

    type Chi_ViewerProtocolPolicy struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ViewerProtocolPolicy,omitempty" json:"ViewerProtocolPolicy,omitempty"`
    }

    type Chi_MinTTL struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    MinTTL,omitempty" json:"MinTTL,omitempty"`
    }

    type Chi_AllowedMethods struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AllowedMethods,omitempty" json:"AllowedMethods,omitempty"`
    }

    type Chi_DistributionConfig struct {
         Chi_Aliases *Chi_Aliases
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Aliases,omitempty"
    json:"Aliases,omitempty"`
         Chi_CacheBehaviors *Chi_CacheBehaviors
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CacheBehaviors,omitempty" json:"CacheBehaviors,omitempty"`
         Chi_CallerReference *Chi_CallerReference
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CallerReference,omitempty" json:"CallerReference,omitempty"`
         Chi_Comment *Chi_Comment
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Comment,omitempty"
    json:"Comment,omitempty"`
         Chi_CustomErrorResponses *Chi_CustomErrorResponses
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomErrorResponses,omitempty" json:"CustomErrorResponses,omitempty"`
         Chi_DefaultCacheBehavior *Chi_DefaultCacheBehavior
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DefaultCacheBehavior,omitempty" json:"DefaultCacheBehavior,omitempty"`
         Chi_DefaultRootObject *Chi_DefaultRootObject
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DefaultRootObject,omitempty" json:"DefaultRootObject,omitempty"`
         Chi_Enabled *Chi_Enabled
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Enabled,omitempty"
    json:"Enabled,omitempty"`
         Chi_Logging *Chi_Logging
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Logging,omitempty"
    json:"Logging,omitempty"`
         Chi_Origins *Chi_Origins
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Origins,omitempty"
    json:"Origins,omitempty"`
         Chi_PriceClass *Chi_PriceClass
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ PriceClass,omitempty"
    json:"PriceClass,omitempty"`
         Chi_Restrictions *Chi_Restrictions
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Restrictions,omitempty" json:"Restrictions,omitempty"`
         Chi_ViewerCertificate *Chi_ViewerCertificate
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ViewerCertificate,omitempty" json:"ViewerCertificate,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DistributionConfig,omitempty" json:"DistributionConfig,omitempty"`
    }

    type Chi_ViewerCertificate struct {
         Chi_CloudFrontDefaultCertificate *Chi_CloudFrontDefaultCertificate
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CloudFrontDefaultCertificate,omitempty"
    json:"CloudFrontDefaultCertificate,omitempty"`
         Chi_IAMCertificateId *Chi_IAMCertificateId
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    IAMCertificateId,omitempty" json:"IAMCertificateId,omitempty"`
         Chi_SSLSupportMethod *Chi_SSLSupportMethod
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    SSLSupportMethod,omitempty" json:"SSLSupportMethod,omitempty"`
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ViewerCertificate,omitempty" json:"ViewerCertificate,omitempty"`
    }

    type Chi_IAMCertificateId struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    IAMCertificateId,omitempty" json:"IAMCertificateId,omitempty"`
    }

    type Chi_CloudFrontDefaultCertificate struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CloudFrontDefaultCertificate,omitempty"
    json:"CloudFrontDefaultCertificate,omitempty"`
    }

    type Chi_SSLSupportMethod struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    SSLSupportMethod,omitempty" json:"SSLSupportMethod,omitempty"`
    }

    type Chi_DefaultCacheBehavior struct {
         Chi_AllowedMethods *Chi_AllowedMethods
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    AllowedMethods,omitempty" json:"AllowedMethods,omitempty"`
         Chi_ForwardedValues *Chi_ForwardedValues
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ForwardedValues,omitempty" json:"ForwardedValues,omitempty"`
         Chi_MinTTL *Chi_MinTTL
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ MinTTL,omitempty"
    json:"MinTTL,omitempty"`
         Chi_SmoothStreaming *Chi_SmoothStreaming
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    SmoothStreaming,omitempty" json:"SmoothStreaming,omitempty"`
         Chi_TargetOriginId *Chi_TargetOriginId
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TargetOriginId,omitempty" json:"TargetOriginId,omitempty"`
         Chi_TrustedSigners *Chi_TrustedSigners
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    TrustedSigners,omitempty" json:"TrustedSigners,omitempty"`
         Chi_ViewerProtocolPolicy *Chi_ViewerProtocolPolicy
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    ViewerProtocolPolicy,omitempty" json:"ViewerProtocolPolicy,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DefaultCacheBehavior,omitempty" json:"DefaultCacheBehavior,omitempty"`
    }

    type Chi_CacheBehaviors struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CacheBehaviors,omitempty" json:"CacheBehaviors,omitempty"`
    }

    type Chi_CustomErrorResponses struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CustomErrorResponses,omitempty" json:"CustomErrorResponses,omitempty"`
    }

    type Chi_Logging struct {
         Chi_Bucket *Chi_Bucket
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Bucket,omitempty"
    json:"Bucket,omitempty"`
         Chi_Enabled *Chi_Enabled
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Enabled,omitempty"
    json:"Enabled,omitempty"`
         Chi_IncludeCookies *Chi_IncludeCookies
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    IncludeCookies,omitempty" json:"IncludeCookies,omitempty"`
         Chi_Prefix *Chi_Prefix
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Prefix,omitempty"
    json:"Prefix,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Logging,omitempty" json:"Logging,omitempty"`
    }

    type Chi_IncludeCookies struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    IncludeCookies,omitempty" json:"IncludeCookies,omitempty"`
    }

    type Chi_Bucket struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Bucket,omitempty" json:"Bucket,omitempty"`
    }

    type Chi_Prefix struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Prefix,omitempty" json:"Prefix,omitempty"`
    }

    type Chi_Restrictions struct {
         Chi_GeoRestriction *Chi_GeoRestriction
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    GeoRestriction,omitempty" json:"GeoRestriction,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Restrictions,omitempty" json:"Restrictions,omitempty"`
    }

    type Chi_GeoRestriction struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         Chi_RestrictionType *Chi_RestrictionType
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    RestrictionType,omitempty" json:"RestrictionType,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    GeoRestriction,omitempty" json:"GeoRestriction,omitempty"`
    }

    type Chi_RestrictionType struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    RestrictionType,omitempty" json:"RestrictionType,omitempty"`
    }

    type Chi_Comment struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Comment,omitempty" json:"Comment,omitempty"`
    }

    type Chi_PriceClass struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    PriceClass,omitempty" json:"PriceClass,omitempty"`
    }

    type Chi_CallerReference struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    CallerReference,omitempty" json:"CallerReference,omitempty"`
    }

    type Chi_Aliases struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Aliases,omitempty" json:"Aliases,omitempty"`
    }

    type Chi_DefaultRootObject struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    DefaultRootObject,omitempty" json:"DefaultRootObject,omitempty"`
    }

    type Chi_Origins struct {
         Chi_Items *Chi_Items
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Items,omitempty"
    json:"Items,omitempty"`
         Chi_Quantity *Chi_Quantity
    `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/ Quantity,omitempty"
    json:"Quantity,omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Origins,omitempty" json:"Origins,omitempty"`
    }

    type Chi_Status struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    Status,omitempty" json:"Status,omitempty"`
    }

    type Chi_LastModifiedTime struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    LastModifiedTime,omitempty" json:"LastModifiedTime,omitempty"`
    }

    type Chi_InProgressInvalidationBatches struct {
         Text string `xml:",chardata" json:",omitempty"`
         XMLName xml.Name `xml:"http://cloudfront.amazonaws.com/doc/2014-05-31/
    InProgressInvalidationBatches,omitempty"
    json:"InProgressInvalidationBatches,omitempty"`
    }


    Here is the JSON generated by the Go program generated by chidley:
    {
      "Attr_xmlns": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
      "ActiveTrustedSigners": {
       "Enabled": {
        "Text": "true | false",
        "Enabled": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Enabled"
        }
       },
       "Items": {
        "Signer": {
         "AwsAccountNumber": {
          "Text": "self | AWS account number",
          "AwsAccountNumber": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "AwsAccountNumber"
          }
         },
         "KeyPairIds": {
          "Items": {
           "KeyPairId": {
            "Text": "active key pair associated with \n
    AwsAccountNumber",
            "KeyPairId": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "KeyPairId"
            }
           },
           "Items": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Items"
           }
          },
          "Quantity": {
           "Text": "number of active key pairs for \n
    AwsAccountNumber",
           "Quantity": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Quantity"
           }
          },
          "KeyPairIds": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "KeyPairIds"
          }
         },
         "Signer": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Signer"
         }
        },
        "Items": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Items"
        }
       },
       "Quantity": {
        "Text": "number of unique trusted signers from \n all cache
    behaviors",
        "Quantity": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Quantity"
        }
       },
       "ActiveTrustedSigners": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "ActiveTrustedSigners"
       }
      },
      "DistributionConfig": {
       "Aliases": {
        "Items": {
         "CNAME": {
          "Text": "CNAME alias",
          "CNAME": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "CNAME"
          }
         },
         "Items": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Items"
         }
        },
        "Quantity": {
         "Text": "number of CNAME aliases",
         "Quantity": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Quantity"
         }
        },
        "Aliases": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Aliases"
        }
       },
       "CacheBehaviors": {
        "Items": {
         "CacheBehavior": {
          "AllowedMethods": {
           "Items": {
            "Method": [
             {
              "Text": "GET",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "HEAD",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "DELETE",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "GET",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "HEAD",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "OPTIONS",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "PATCH",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "POST",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             },
             {
              "Text": "PUT",
              "Method": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Method"
              }
             }
            ],
            "Items": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Items"
            }
           },
           "Quantity": {
            "Text": "2 | 7",
            "Quantity": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Quantity"
            }
           },
           "AllowedMethods": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "AllowedMethods"
           }
          },
          "ForwardedValues": {
           "Cookies": {
            "Forward": {
             "Text": "all | whitelist | none",
             "Forward": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "Forward"
             }
            },
            "WhitelistedNames": {
             "Items": {
              "Name": {
               "Text": "name of a cookie to forward to
    \n the origin",
               "Name": {
                "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
                "Local": "Name"
               }
              },
              "Items": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Items"
              }
             },
             "Quantity": {
              "Text": "number of cookie names to \n
    forward to origin",
              "Quantity": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Quantity"
              }
             },
             "WhitelistedNames": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "WhitelistedNames"
             }
            },
            "Cookies": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Cookies"
            }
           },
           "Headers": {
            "Items": {
             "Name": {
              "Text": "header",
              "Name": {
               "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
               "Local": "Name"
              }
             },
             "Items": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "Items"
             }
            },
            "Quantity": {
             "Text": "number of headers to forward to origin",
             "Quantity": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "Quantity"
             }
            },
            "Headers": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Headers"
            }
           },
           "QueryString": {
            "Text": "true | false",
            "QueryString": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "QueryString"
            }
           },
           "ForwardedValues": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ForwardedValues"
           }
          },
          "MinTTL": {
           "Text": "minimum TTL in seconds for files \n
    specified by PathPattern",
           "MinTTL": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "MinTTL"
           }
          },
          "PathPattern": {
           "Text": "pattern that specifies files that this \n
    cache behavior applies to",
           "PathPattern": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "PathPattern"
           }
          },
          "SmoothStreaming": {
           "Text": "true | false",
           "SmoothStreaming": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "SmoothStreaming"
           }
          },
          "TargetOriginId": {
           "Text": "ID of the origin that this cache behavior
    \n applies to",
           "TargetOriginId": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "TargetOriginId"
           }
          },
          "TrustedSigners": {
           "Enabled": {
            "Text": "true | false",
            "Enabled": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Enabled"
            }
           },
           "Items": {
            "AwsAccountNumber": {
             "Text": "self | AWS account that can create
    \n signed URLs",
             "AwsAccountNumber": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "AwsAccountNumber"
             }
            },
            "Items": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Items"
            }
           },
           "Quantity": {
            "Text": "number of trusted signers",
            "Quantity": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Quantity"
            }
           },
           "TrustedSigners": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "TrustedSigners"
           }
          },
          "ViewerProtocolPolicy": {
           "Text": "allow-all | \n redirect-to-https |
    https-only",
           "ViewerProtocolPolicy": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ViewerProtocolPolicy"
           }
          },
          "CacheBehavior": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "CacheBehavior"
          }
         },
         "Items": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Items"
         }
        },
        "Quantity": {
         "Text": "number of cache behaviors",
         "Quantity": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Quantity"
         }
        },
        "CacheBehaviors": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "CacheBehaviors"
        }
       },
       "CallerReference": {
        "Text": "unique description for this\n distribution config",
        "CallerReference": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "CallerReference"
        }
       },
       "Comment": {
        "Text": "comment about the distribution",
        "Comment": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Comment"
        }
       },
       "CustomErrorResponses": {
        "Items": {
         "CustomErrorResponse": {
          "ErrorCachingMinTTL": {
           "Text": "minimum TTL for this \n ErrorCode",
           "ErrorCachingMinTTL": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ErrorCachingMinTTL"
           }
          },
          "ErrorCode": {
           "Text": "HTTP status code for which you want to \n
    customize the response",
           "ErrorCode": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ErrorCode"
           }
          },
          "ResponseCode": {
           "Text": "HTTP status code that you want CloudFront
    \n to return along with the custom error page",
           "ResponseCode": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ResponseCode"
           }
          },
          "ResponsePagePath": {
           "Text": "path to custom error page",
           "ResponsePagePath": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "ResponsePagePath"
           }
          },
          "CustomErrorResponse": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "CustomErrorResponse"
          }
         },
         "Items": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Items"
         }
        },
        "Quantity": {
         "Text": "number of custom error responses",
         "Quantity": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Quantity"
         }
        },
        "CustomErrorResponses": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "CustomErrorResponses"
        }
       },
       "DefaultCacheBehavior": {
        "AllowedMethods": {
         "Items": {
          "Method": [
           {
            "Text": "GET",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "HEAD",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "DELETE",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "GET",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "HEAD",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "OPTIONS",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "PATCH",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "POST",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           },
           {
            "Text": "PUT",
            "Method": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Method"
            }
           }
          ],
          "Items": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Items"
          }
         },
         "Quantity": {
          "Text": "2 | 7",
          "Quantity": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Quantity"
          }
         },
         "AllowedMethods": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "AllowedMethods"
         }
        },
        "ForwardedValues": {
         "Cookies": {
          "Forward": {
           "Text": "all | whitelist | none",
           "Forward": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Forward"
           }
          },
          "WhitelistedNames": {
           "Items": {
            "Name": {
             "Text": "name of a cookie to forward to the origin",
             "Name": {
              "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
              "Local": "Name"
             }
            },
            "Items": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Items"
            }
           },
           "Quantity": {
            "Text": "number of cookie names to \n forward to
    origin",
            "Quantity": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Quantity"
            }
           },
           "WhitelistedNames": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "WhitelistedNames"
           }
          },
          "Cookies": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Cookies"
          }
         },
         "Headers": {
          "Items": {
           "Name": {
            "Text": "header",
            "Name": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "Name"
            }
           },
           "Items": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Items"
           }
          },
          "Quantity": {
           "Text": "number of headers to forward to origin",
           "Quantity": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Quantity"
           }
          },
          "Headers": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Headers"
          }
         },
         "QueryString": {
          "Text": "true | false",
          "QueryString": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "QueryString"
          }
         },
         "ForwardedValues": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "ForwardedValues"
         }
        },
        "MinTTL": {
         "Text": "minimum TTL for objects in seconds",
         "MinTTL": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "MinTTL"
         }
        },
        "SmoothStreaming": {
         "Text": "true | false",
         "SmoothStreaming": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "SmoothStreaming"
         }
        },
        "TargetOriginId": {
         "Text": "ID of the origin that the default cache behavior \n
    applies to",
         "TargetOriginId": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "TargetOriginId"
         }
        },
        "TrustedSigners": {
         "Enabled": {
          "Text": "true | false",
          "Enabled": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Enabled"
          }
         },
         "Items": {
          "AwsAccountNumber": {
           "Text": "self | AWS account that can create \n
    signed URLs",
           "AwsAccountNumber": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "AwsAccountNumber"
           }
          },
          "Items": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Items"
          }
         },
         "Quantity": {
          "Text": "number of trusted signers",
          "Quantity": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Quantity"
          }
         },
         "TrustedSigners": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "TrustedSigners"
         }
        },
        "ViewerProtocolPolicy": {
         "Text": "allow-all | \n redirect-to-https | https-only",
         "ViewerProtocolPolicy": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "ViewerProtocolPolicy"
         }
        },
        "DefaultCacheBehavior": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "DefaultCacheBehavior"
        }
       },
       "DefaultRootObject": {
        "Text": "URL for default root object",
        "DefaultRootObject": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "DefaultRootObject"
        }
       },
       "Enabled": {
        "Text": "true | false",
        "Enabled": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Enabled"
        }
       },
       "Logging": {
        "Bucket": {
         "Text": "Amazon S3 bucket to save logs in",
         "Bucket": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Bucket"
         }
        },
        "Enabled": {
         "Text": "true | false",
         "Enabled": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Enabled"
         }
        },
        "IncludeCookies": {
         "Text": "true | false",
         "IncludeCookies": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "IncludeCookies"
         }
        },
        "Prefix": {
         "Text": "prefix for log filenames",
         "Prefix": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Prefix"
         }
        },
        "Logging": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Logging"
        }
       },
       "Origins": {
        "Items": {
         "Origin": {
          "CustomOriginConfig": {
           "HTTPPort": {
            "Text": "HTTP port that the custom origin \n
    listens on",
            "HTTPPort": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "HTTPPort"
            }
           },
           "HTTPSPort": {
            "Text": "HTTPS port that the custom origin \n
    listens on",
            "HTTPSPort": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "HTTPSPort"
            }
           },
           "OriginProtocolPolicy": {
            "Text": "http-only | \n match-viewer",
            "OriginProtocolPolicy": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "OriginProtocolPolicy"
            }
           },
           "CustomOriginConfig": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "CustomOriginConfig"
           }
          },
          "DomainName": {
           "Text": "domain name of origin",
           "DomainName": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "DomainName"
           }
          },
          "Id": {
           "Text": "unique identifier for this origin",
           "Id": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Id"
           }
          },
          "S3OriginConfig": {
           "OriginAccessIdentity": {
            "Text": "origin-access-identity/\n
    cloudfront/Id",
            "OriginAccessIdentity": {
             "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
             "Local": "OriginAccessIdentity"
            }
           },
           "S3OriginConfig": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "S3OriginConfig"
           }
          },
          "Origin": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Origin"
          }
         },
         "Items": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Items"
         }
        },
        "Quantity": {
         "Text": "number of origins",
         "Quantity": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "Quantity"
         }
        },
        "Origins": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Origins"
        }
       },
       "PriceClass": {
        "Text": "maximum price class for the distribution",
        "PriceClass": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "PriceClass"
        }
       },
       "Restrictions": {
        "GeoRestriction": {
         "Items": {
          "Location": {
           "Text": "two-letter country code in upper case",
           "Location": {
            "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
            "Local": "Location"
           }
          },
          "Items": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Items"
          }
         },
         "Quantity": {
          "Text": "number of countries \n in the blacklist or
    whitelist",
          "Quantity": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "Quantity"
          }
         },
         "RestrictionType": {
          "Text": "blacklist | whitelist | none",
          "RestrictionType": {
           "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
           "Local": "RestrictionType"
          }
         },
         "GeoRestriction": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "GeoRestriction"
         }
        },
        "Restrictions": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "Restrictions"
        }
       },
       "ViewerCertificate": {
        "CloudFrontDefaultCertificate": {
         "Text": true,
         "CloudFrontDefaultCertificate": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "CloudFrontDefaultCertificate"
         }
        },
        "IAMCertificateId": {
         "Text": "IAM certificate ID",
         "IAMCertificateId": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "IAMCertificateId"
         }
        },
        "SSLSupportMethod": {
         "Text": "vip | sni-only",
         "SSLSupportMethod": {
          "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
          "Local": "SSLSupportMethod"
         }
        },
        "Text": "\n | \n \n \n ",
        "ViewerCertificate": {
         "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
         "Local": "ViewerCertificate"
        }
       },
       "DistributionConfig": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "DistributionConfig"
       }
      },
      "DomainName": {
       "Text": "CloudFront domain name assigned to the \n distribution",
       "DomainName": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "DomainName"
       }
      },
      "Id": {
       "Text": "ID for the distribution",
       "Id": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "Id"
       }
      },
      "InProgressInvalidationBatches": {
       "Text": "number of invalidation batches being \n processed for this
    distribution",
       "InProgressInvalidationBatches": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "InProgressInvalidationBatches"
       }
      },
      "LastModifiedTime": {
       "Text": "creation date and time in \n ISO 8601 format",
       "LastModifiedTime": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "LastModifiedTime"
       }
      },
      "Status": {
       "Text": "Deployed | InProgress",
       "Status": {
        "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
        "Local": "Status"
       }
      },
      "Distribution": {
       "Space": "http://cloudfront.amazonaws.com/doc/2014-05-31/",
       "Local": "Distribution"
      }
    }
    On Sunday, February 9, 2014 10:47:05 AM UTC-5, Marco TNP wrote:

    I need to have go Structs from a XML to be able to use this and change the
    values. It's a big XML.

    Actually, this XML response here ->
    http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetDistribution.html

    Do anybody know any easy way to write this XML structure to a Go struct?

    I don't think it's the best to do this by hand. Because of the time to do
    it and the many possibilities of mistakes. So i decided to ask you.

    Let me know if I'm lacking on explanation of the problem.

    Thank you!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 9, '14 at 3:47p
activeAug 28, '14 at 11:47a
posts16
users9
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase