More Flexibility inside *Elements Structs
jhonore opened this issue · comments
Judes HONORE commented
// A SimpleElement is an Element with a single value.
type SimpleElement struct {
xml.StartElement
value string
}
// A CompoundElement is an Element with children.
type CompoundElement struct {
xml.StartElement
children []Element
}
// A SharedElement is an element with an id.
type SharedElement struct {
CompoundElement
id string
}
Those struct should have get/setter for custom user modifications
See below an example for SimpleElement.
func (s *SimpleElement) GetValue(value string) {
s.value = value
}
That allow user to customize Element or create new ones.
Tom Payne commented
I've tagged version 1.5.2 so you can pick up a new Go module with the changes.