Bot releases are hidden (Show)
Updates
Published by beevik 5 months ago
New Features
AutoClose
option to ReadSettings
.ValidateInput
to ReadSettings
.NotNil
function to Element
.NextSibling
and PrevSibling
functions to Element
.Published by beevik 10 months ago
New Features
PreserveDuplicateAttrs
to ReadSettings
.ReindexChildren
to Element
.Full Changelog: https://github.com/beevik/etree/compare/v1.2.0...v1.3.0
Published by beevik over 1 year ago
New Features
Published by beevik over 1 year ago
New Features
Removed Features
Published by beevik over 1 year ago
Element.Text
function now handles comments embedded between character data spans.go.mod
to 1.20Published by beevik over 5 years ago
New Features
Element.SortAttrs
method, which lexicographically sorts an element's attributes by key.ReadSettings
properties.
Entity
for the support of custom entity maps.WriteSettings
properties.
UseCRLF
to allow the output of CR-LF newlines instead of the default LF newlines. This is useful on Windows systems.Element.Text
method now returns the concatenation of all consecutive character data tokens immediately following an element's opening tag.Element.SetCData
to replace the character data immediately following an element's opening tag with a CDATA section.Element.CreateCData
to create and add a CDATA section child CharData
token to an element.Element.CreateText
to create and add a child text CharData
token to an element.NewCData
to create a parentless CDATA section CharData
token.NewText
to create a parentless text CharData
token.CharData.IsCData
to detect if the token contains a CDATA section.CharData.IsWhitespace
to detect if the token contains whitespace inserted by one of the document Indent functions.Element.SetText
so that it replaces a run of consecutive character data tokens following the element's opening tag (instead of just the first one).Element.Tail
method, which returns the text immediately following an element's closing tag.Element.SetTail
method, which modifies the text immediately following an element's closing tag.Element.InsertChildAt
method, which inserts a new child token before the specified child token index.Element.RemoveChildAt
method, which removes the child token at the specified child token index.Element.Index
method, which returns the element's index within its parent element's child token list.Element.NamespaceURI
method to return the namespace URI associated with an element.Attr.NamespaceURI
method to return the namespace URI associated with an element.Attr.Element
method to return the element that an attribute belongs to.[local-name()='val']
to keep elements whose unprefixed tag matches the desired value.[name()='val']
to keep elements whose full tag matches the desired value.[namespace-prefix()='val']
to keep elements whose namespace prefix matches the desired value.[namespace-uri()='val']
to keep elements whose namespace URI matches the desired value.Bug Fixes
CharSetReader
is now used to prevent failed parsing of XML documents using certain encodings. (Issue).Document.Indent
and Document.IndentTabs
functions no longer insert empty string CharData
tokens.Deprecated
Element
InsertChild
method is deprecated. Use InsertChildAt
instead.CreateCharData
method is deprecated. Use CreateText
instead.CharData
NewCharData
method is deprecated. Use NewText
instead.Published by beevik over 6 years ago
Changes
/
or //
and begins a search from the element's document root.GetPath
and GetRelativePath
functions to the Element
type.Breaking changes
//
is now interpreted as an absolute path. Previously, it was interpreted as a relative path starting from the element whose FindElement
method was called. To remain compatible with this release, all paths prefixed with //
should be prefixed with .//
when used with any element other than the document's root.Published by beevik about 7 years ago
The etree package is a lightweight, pure go package that expresses XML in the form of an element tree. Its design was inspired by the Python ElementTree module. Some of the package's features include:
This is the first official release of etree
, a go package that has been around for some time but until now has not played well with go vendoring solutions.