FAQ
This is probably a stupid question, but I could not get it to work. Suppose
I have an XML file like this:

<?xml version="1.0" encoding="UTF-8" ?>
<Result>blah</Result>

How exactly would I go about unmarshaling?

What is weird is that I can easily unmarshal something like this:

<?xml version="1.0" encoding="UTF-8" ?>
<Result><Entry>blah<Entry></Result>


-Bruno

--

Search Discussions

  • Kevin Gillette at Sep 27, 2012 at 5:27 am
    What code are you using to unmarhsal with?
    On Wednesday, September 26, 2012 5:40:30 PM UTC-6, Bruno Albuquerque wrote:

    This is probably a stupid question, but I could not get it to work.
    Suppose I have an XML file like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Result>blah</Result>

    How exactly would I go about unmarshaling?

    What is weird is that I can easily unmarshal something like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Result><Entry>blah<Entry></Result>


    -Bruno
    --
  • Minux at Sep 27, 2012 at 8:03 am

    On Thu, Sep 27, 2012 at 7:40 AM, Bruno Albuquerque wrote:

    This is probably a stupid question, but I could not get it to work.
    Suppose I have an XML file like this:


    <?xml version="1.0" encoding="UTF-8" ?>
    <Result>blah</Result>

    How exactly would I go about unmarshaling?
    You can just unmarshal it into a string (no struct needed).

    --
  • Clbanning at Sep 27, 2012 at 1:29 pm
    Or use https://github.com/clbanning/x2j to unmarshal to
    map[string]interface{}.
    On Wednesday, September 26, 2012 6:40:30 PM UTC-5, Bruno Albuquerque wrote:

    This is probably a stupid question, but I could not get it to work.
    Suppose I have an XML file like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Result>blah</Result>

    How exactly would I go about unmarshaling?

    What is weird is that I can easily unmarshal something like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Result><Entry>blah<Entry></Result>


    -Bruno
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 26, '12 at 11:47p
activeSep 27, '12 at 1:29p
posts4
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase