While doing some HTML hacking today (yes I do understand
that XML and HTML are not the same thing), I came across
two behaviours of encoding/eml that indicate least one of
* I don't actually understand xml as much as I thought
* I don't understand encoding/xml as much as I'd hoped
* I don't understand HTML as well as I thought
* CASE NIGHTMARE GREEN is upon us
which parses some XML from a string and then encodes it
back to stdout.
(a) If an xmlns=WOSSNAME is present then when encoding
EVERY element has been given an xmlns=WOSSNAME
Is this intended? If so, what's the reason? Is it controllable
and can I switch it off?
(a') How does Encode know what xmlns to (mis?) write? My
struct Result doesn't have a slot for it and the decoder and
encoder don't obviously share store. Did I miss some
documentation about shared state in encoding/xml?
(b) The (documented in encoding/xml Marshal) behaviour
that all the chardata fields are smooshed up into one lump
seems strange. It means a structure such as the example
<p>This is the <i>first</i> verse.</p>
loses track completely of where the <i> subelement appeared
within the <p>. Is this an XML thing that all the chardata of
an element forms one text, and does this also in fact apply to
HTML but I never knew?
[The HTML that provoked this discovery was from an External
Source, in somwhat iffy state, and had been tempered by passing
it through tidy. Answers reminiscent of "you should write proper
HTML in the first place!" would be pointmissing.]
Chris "allusive" Dollin
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 email@example.com.
For more options, visit https://groups.google.com/d/optout.