twpayne/go-kml

More Flexibility inside *Elements Structs

jhonore opened this issue · 2 comments

// 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.

Thanks for the suggestion - good idea - fixed in #17.

I've tagged version 1.5.2 so you can pick up a new Go module with the changes.