Documentation
¶
Index ¶
- Variables
- func Render(e *Element, w io.Writer, vars ...bool) error
- func Set64Image(root *Element, id string, content string) error
- func SetContent(root *Element, id string, text string) error
- func SetImage(root *Element, id string, path string, embed bool) error
- func SetSortAttributes(v bool)
- type Element
- func (e *Element) Compare(o *Element) bool
- func (e *Element) Decode(root *Element, decoder *xml.Decoder) error
- func (e *Element) Encode(encoder *xml.Encoder) error
- func (e *Element) FindAll(name string) []*Element
- func (e *Element) FindID(id string) *Element
- func (e *Element) Serialize() xml.StartElement
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrElementNotFound = errors.New("element not found")
)
define library errors
Functions ¶
func Set64Image ¶
Set64Image replace element embeded image by id
func SetContent ¶
SetContent replace element text by id
func SetSortAttributes ¶
func SetSortAttributes(v bool)
SetSortAttributes override value whether we need to sort attribute during serialization
Types ¶
type Element ¶
type Element struct { Name string Attributes map[string]string Children []*Element Content string // namespace dict extracted form root element attrributes // which prefixed with xmlns: Namespaces map[string]string }
Element is a representation of an SVG element.
func DecodeFirst ¶
DecodeFirst creates the first element from the decoder.
func NewElement ¶
func NewElement(root *Element, token xml.StartElement) *Element
NewElement creates element from decoder token.
func (*Element) Serialize ¶
func (e *Element) Serialize() xml.StartElement
Serialize serializes element
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
ValidationError contains errors which have occured when parsing svg input.
func (ValidationError) Error ¶
func (err ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.