On 20 February 2015 at 12:47, Mark Petrovic <
mspet...@gmail.com> wrote:
> That does fit my needs, thank you.
Great!
>
> I now see how the unmarshal handles the aliasing. In the case of a
> traditional POM, it changes the name of the attributed namespace, but I
> think that's ok for what I need. I doubt anyone will even notice, in fact,
> were they to read the POM.
Yes, that's a down side of the current Go approach. From the
XML point of view, the namespace alias shouldn't matter at all,
but it would perhaps be nice if Go had a better algorithm for
choosing a nice looking one.
> One last question: I notice you changed the type of XMLName from xml.Name
> to struct{}. What is the motivation for doing that?
The XMLName type is useful for containing an XML name. In your
case, you don't need any data there, so using a struct{}
provides a zero-overhead way of setting your XML name space,
while also reassuring the reader that there is nothing to
be concerned about in the XMLName field contents.
cheers,
rog.