Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/xml : documentation clarity - Unmarshal #8784
In the documentation for Unmarshall http://golang.org/pkg/encoding/xml/#Unmarshal 1. The ",chardata" tag if entered as written gives an error ".. invalid tag in field .." - capitalisation ",charData" works. Similar issue for ",innerxml" which gives the same error, unless a different capitalisation is used eg ",innerXML" or ",innerXml" This wasn't obvious. requesting doc shows correct working capitalisations 2. The descriptions of same are not 100% clear: ie chardata : "If the XML element contains character data, that data is accumulated in the first struct field that has tag ",chardata" .." initial interpretation was that this captured only CDATA type data - this was not the case and captured non CDATA chars innerxml : "Unmarshal accumulates the raw XML nested inside the element in that field" initial expectation was to capture all inner data (excluding CDATA) including nested xml elements - this was not the case as CDATA was captured but not nested xml elements or their contents Not entirely sure what the intended behaviour is. So some additional clarity in documentation would be a great help. (Similar issue with ",any" tag - not sure if bug or docs issue - but did not appear to capture uncaptured xml elements as expected, will file separate issue after checking)
This issue was closed.