FAQ
Hi all,

I want to decode unknown elements from a xml stream, but it doesn't seem to
work with the current version of the xml package.

I've found this thread on the mailing list (with an example from Steven
Blenkinsop):
https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/Z2NuCOJXsnI

Here is the modified version of the source code which compiles with Go 1:
http://play.golang.org/p/4WvUem0BLQ

But it always gives me "[no output]". Is it possible to record *any*element to a struct without knowing the elements name?

Thanks
Christoph

--

Search Discussions

  • Volker Dobler at Sep 24, 2012 at 2:54 pm
    I don't think this is possible.
    Try to parse the XML yourself with a Decoder. This also
    allows you to skip bad/malicious stuff.

    Volker
    On 24 Sep., 13:34, Christoph Schunk wrote:
    Hi all,

    I want to decode unknown elements from a xml stream, but it doesn't seem to
    work with the current version of the xml package.

    I've found this thread on the mailing list (with an example from Steven
    Blenkinsop):https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/Z2NuC...

    Here is the modified version of the source code which compiles with Go 1:http://play.golang.org/p/4WvUem0BLQ

    But it always gives me "[no output]". Is it possible to record *any*element to a struct without knowing the elements name?

    Thanks
    Christoph
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 24, '12 at 11:34a
activeSep 24, '12 at 2:54p
posts2
users2
websitegolang.org

2 users in discussion

Christoph Schunk: 1 post Volker Dobler: 1 post

People

Translate

site design / logo © 2021 Grokbase