github.com/beevik/etree
v1.7.1
#1282 most downloaded on Go modules
beevik/etree
What this package is like to depend on
Last release 8 days ago
15 Aug 2026
Release timing varies
gaps range from 8 days to 11 months
Nearly every release is documented
notes for 16 of 16 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
139 releases · first in 2013
3 releases in the last 12 months
see the full history below
Release timeline
139 releases · Jun 2013 to Aug 2026Releases
latest 60 of 139-
v1.7.115 Aug 2026 -
v1.7.012 Jul 2026Release notes
Open source →Breaking changes
- To address a security issue, it was necessary to add a
MaxDepthoption to
ReadSettingsto limit the depth of XML trees during parsing. A generous
default value of 1024 was chosen to avoid breaking most existing code.
However, if your code is processing XML hierarchies with a depth greater
than 1024, you will need to assign yourDocumentaReadSettingsthat has
aMaxDepthset to a higher value.
Security Fixes
- Limited the depth of XML trees processed by all
ReadFromfunctions during
parsing. - Fixed a
CompilePathindex-out-of-range panic that could be caused by a
missing path filter key. - Sanitized the contents of XML text, comment, ProcInst and Directive tokens
provided by the user.
Release notes
Open source →Breaking changes
- To address a security issue, it was necessary to add a
MaxDepthoption toReadSettingsto limit the depth of XML trees during parsing. A generous default value of 1024 was chosen to avoid breaking most existing code. However, if your code is processing XML hierarchies with a depth greater than 1024, you will need to assign yourDocumentaReadSettingsthat has aMaxDepthset to a higher value.
Security Fixes
- Limited the depth of XML trees processed by all
ReadFromfunctions during parsing. - Fixed a
CompilePathindex-out-of-range panic that could be caused by a missing path filter key. - Sanitized the contents of XML text, comment, ProcInst and Directive tokens provided by the user.
- To address a security issue, it was necessary to add a
-
v1.6.022 Aug 2025Release notes
Open source →Changes
- Added new iterator versions of existing functions that return slices of
Elementpointers:ChildElementsSeq,SelectElementsSeq,FindElementsSeq, andFindElementsPathSeq. - Improved performance of functions that return a single element.
- Because of its use of iterators, this package now requires go 1.23 or later.
Release notes
Open source →Changes
- Added new iterator versions of existing functions that return slices of
Elementpointers:ChildElementsSeq,SelectElementsSeq,FindElementsSeq, andFindElementsPathSeq. - Improved performance of functions that return a single element.
- Because of its use of iterators, this package now requires go 1.23 or later.
- Added new iterator versions of existing functions that return slices of
-
v1.5.2-0.20250822224909-df3ff128161422 Aug 2025 pre-releaseNothing published for this version
-
v1.5.115 Apr 2025 -
v1.5.1-0.20250306061641-d7975c45bee306 Mar 2025 pre-releaseNothing published for this version
-
v1.5.030 Jan 2025Release notes
Open source →Changes
- Added
ElementfunctionCreateChild, which calls a continuation function
after creating and adding a child element.
Fixes
- Removed a potential conflict between two
ReadSettingsvalues. When
AttrSingleQuoteis true,CanonicalAttrValis forced to be false.
Release notes
Open source →Changes
- Added
ElementfunctionCreateChild, which calls a continuation function after creating and adding a child element.
Fixes
- Removed a potential conflict between two
ReadSettingsvalues. WhenAttrSingleQuoteis true,CanonicalAttrValis forced to be false.
- Added
-
v1.4.2-0.20250128174814-7cf4882e758128 Jan 2025 pre-releaseNothing published for this version
-
v1.4.2-0.20240718152344-e732393ea40418 Jul 2024 pre-releaseNothing published for this version
-
v1.4.2-0.20240718152227-8965a489c0b118 Jul 2024 pre-releaseNothing published for this version
-
v1.4.117 Jul 2024Release notes
Open source →Updates
- Minimal go version updated to 1.21.
- Default-initialized CharsetReader causes same result as NewDocument().
- When reading an XML document, attributes are parsed more efficiently.
Release notes
Open source →Changes
- Minimal go version updated to 1.21.
- Default-initialized CharsetReader causes same result as NewDocument().
- When reading an XML document, attributes are parsed more efficiently.
-
v1.4.1-0.20240716052356-65fc6ef46f4516 Jul 2024 pre-releaseNothing published for this version
-
v1.4.1-0.20240710030836-fdd11bdbc90810 Jul 2024 pre-releaseNothing published for this version
-
v1.4.1-0.20240708061437-e8292cc4b95108 Jul 2024 pre-releaseNothing published for this version
-
v1.4.1-0.20240707195041-7113fd9e29dc07 Jul 2024 pre-releaseNothing published for this version
-
v1.4.1-0.20240706042457-97f4565f23c306 Jul 2024 pre-releaseNothing published for this version
-
v1.4.1-0.20240706041930-cd046772525806 Jul 2024 pre-releaseNothing published for this version
-
v1.4.013 May 2024Release notes
Open source →New Features
- Add
AutoCloseoption toReadSettings. - Add
ValidateInputtoReadSettings. - Add
NotNilfunction toElement. - Add
NextSiblingandPrevSiblingfunctions toElement.
Release notes
Open source →New Features
- Add
AutoCloseoption toReadSettings. - Add
ValidateInputtoReadSettings. - Add
NotNilfunction toElement. - Add
NextSiblingandPrevSiblingfunctions toElement.
- Add
-
v1.3.1-0.20240513191811-4fe8b8ce88c013 May 2024 pre-releaseNothing published for this version
-
v1.3.1-0.20240503224708-cc099d9d974803 May 2024 pre-releaseNothing published for this version
-
v1.3.1-0.20240428200951-cda5fc441f5d28 Apr 2024 pre-releaseNothing published for this version
-
v1.3.1-0.20240428121254-d21e1ceeed8a28 Apr 2024 pre-releaseNothing published for this version
-
v1.3.031 Dec 2023Release notes
Open source →New Features
- Add support for double-quotes in filter path queries.
- Add
PreserveDuplicateAttrstoReadSettings. - Add
ReindexChildrentoElement.
Full Changelog: v1.2.0...v1.3.0
Release notes
Open source →New Features
- Add support for double-quotes in filter path queries.
- Add
PreserveDuplicateAttrstoReadSettings. - Add
ReindexChildrentoElement.
-
v1.2.1-0.20231231204534-d46b199f3e7d31 Dec 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20231223193218-3f4526ce00c823 Dec 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20230829014414-8da548e3890e29 Aug 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20230715204354-8a4dcdaf5e5315 Jul 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20230715204151-480bc7ed391015 Jul 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20230715191114-f3d944a38c0115 Jul 2023 pre-releaseNothing published for this version
-
v1.2.1-0.20230605182635-f9721ff411f605 Jun 2023 pre-releaseNothing published for this version
-
v1.2.011 May 2023Release notes
Open source →New Features
- Add the ability to write XML fragments using Token WriteTo functions.
- Add the ability to re-indent an XML element as though it were the root of the document.
- Add a ReadSettings option to preserve CDATA blocks when reading an XML document.
Release notes
Open source →New Features
- Add the ability to write XML fragments using Token WriteTo functions.
- Add the ability to re-indent an XML element as though it were the root of the document.
- Add a ReadSettings option to preserve CDATA blocks when reading and XML document.
-
v1.1.5-0.20230511180417-ecaabe80884211 May 2023 pre-releaseNothing published for this version
-
v1.1.5-0.20230511153522-a291eec2339111 May 2023 pre-releaseNothing published for this version
-
v1.1.5-0.20230508232633-672dfa1bf64608 May 2023 pre-releaseNothing published for this version
-
v1.1.408 May 2023Release notes
Open source →New Features
- Add the ability to preserve whitespace in leaf elements during indent.
- Add the ability to suppress a document-trailing newline during indent.
- Add choice of XML attribute quoting style (single-quote or double-quote).
Removed Features
- Removed the CDATA preservation change introduced in v1.1.3. It was implemented in a way that broke the ability to process XML documents encoded using non-UTF8 character sets.
Release notes
Open source →New Features
- Add the ability to preserve whitespace in leaf elements during indent.
- Add the ability to suppress a document-trailing newline during indent.
- Add choice of XML attribute quoting style (single-quote or double-quote).
Removed Features
- Removed the CDATA preservation change introduced in v1.1.3. It was implemented in a way that broke the ability to process XML documents encoded using non-UTF8 character sets.
-
v1.1.4-0.20230507200059-211cdce3bc3707 May 2023 pre-releaseNothing published for this version
-
v1.1.4-0.20230504232214-2f634e1b578c04 May 2023 pre-releaseNothing published for this version
-
v1.1.4-0.20230502181414-3278e30cd0cd02 May 2023 pre-releaseNothing published for this version
-
v1.1.4-0.20230502040559-c04c9615d8a002 May 2023 pre-releaseNothing published for this version
-
v1.1.302 May 2023Release notes
Open source →- XML reads now preserve CDATA sections instead of converting them to standard character data.
-
v1.1.3-0.20230502033806-5a0225a63a4f02 May 2023 pre-releaseNothing published for this version
-
v1.1.3-0.20230502013909-1288176cb1bb02 May 2023 pre-releaseNothing published for this version
-
v1.1.202 May 2023Release notes
Open source →- Fixed a path parsing bug.
- The
Element.Textfunction now handles comments embedded between character data spans.
-
v1.1.102 May 2023 -
v1.1.1-0.20230502000224-63a79760bd8b02 May 2023 pre-releaseNothing published for this version
-
v1.1.1-0.20200718192613-4a2f8b9d084c18 Jul 2020 pre-releaseNothing published for this version
-
v1.1.1-0.20200623191853-977ca2e3ccc723 Jun 2020 pre-releaseNothing published for this version
-
v1.1.1-0.20191114232641-23e6ba8cc2de14 Nov 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20191105050252-dcd53a58ac7405 Nov 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190605174243-6e5cd8a3021605 Jun 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190531201712-ef86ce21ad3031 May 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190218190655-4ec13055402818 Feb 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190217061645-ab7d1938ddc317 Feb 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190212154729-3c11c35e332112 Feb 2019 pre-releaseNothing published for this version
-
v1.1.1-0.20190206032026-76880d49f6ce06 Feb 2019 pre-releaseNothing published for this version
-
v1.1.002 Feb 2019Release notes
Open source →New Features
- New attribute helpers.
- Added the
Element.SortAttrsmethod, which lexicographically sorts an element's attributes by key.
- Added the
- New
ReadSettingsproperties.- Added
Entityfor the support of custom entity maps.
- Added
- New
WriteSettingsproperties.- Added
UseCRLFto allow the output of CR-LF newlines instead of the default LF newlines. This is useful on Windows systems.
- Added
- Additional support for text and CDATA sections.
- The
Element.Textmethod now returns the concatenation of all consecutive character data tokens immediately following an element's opening tag. - Added
Element.SetCDatato replace the character data immediately following an element's opening tag with a CDATA section. - Added
Element.CreateCDatato create and add a CDATA section childCharDatatoken to an element. - Added
Element.CreateTextto create and add a child textCharDatatoken to an element. - Added
NewCDatato create a parentless CDATA sectionCharDatatoken. - Added
NewTextto create a parentless textCharDatatoken. - Added
CharData.IsCDatato detect if the token contains a CDATA section. - Added
CharData.IsWhitespaceto detect if the token contains whitespace inserted by one of the document Indent functions. - Modified
Element.SetTextso that it replaces a run of consecutive character data tokens following the element's opening tag (instead of just the first one).
- The
- New "tail text" support.
- Added the
Element.Tailmethod, which returns the text immediately following an element's closing tag. - Added the
Element.SetTailmethod, which modifies the text immediately following an element's closing tag.
- Added the
- New element child insertion and removal methods.
- Added the
Element.InsertChildAtmethod, which inserts a new child token before the specified child token index. - Added the
Element.RemoveChildAtmethod, which removes the child token at the specified child token index.
- Added the
- New element and attribute queries.
- Added the
Element.Indexmethod, which returns the element's index within its parent element's child token list. - Added the
Element.NamespaceURImethod to return the namespace URI associated with an element. - Added the
Attr.NamespaceURImethod to return the namespace URI associated with an element. - Added the
Attr.Elementmethod to return the element that an attribute belongs to.
- Added the
- New Path filter functions.
- Added
[local-name()='val']to keep elements whose unprefixed tag matches the desired value. - Added
[name()='val']to keep elements whose full tag matches the desired value. - Added
[namespace-prefix()='val']to keep elements whose namespace prefix matches the desired value. - Added
[namespace-uri()='val']to keep elements whose namespace URI matches the desired value.
- Added
Bug Fixes
- A default XML
CharSetReaderis now used to prevent failed parsing of XML documents using certain encodings. (Issue). - All characters are now properly escaped according to XML parsing rules. (Issue).
- The
Document.IndentandDocument.IndentTabsfunctions no longer insert empty stringCharDatatokens.
Deprecated
Element- The
InsertChildmethod is deprecated. UseInsertChildAtinstead. - The
CreateCharDatamethod is deprecated. UseCreateTextinstead.
- The
CharData- The
NewCharDatamethod is deprecated. UseNewTextinstead.
- The
- New attribute helpers.
-
v1.0.2-0.20200718192613-4a2f8b9d084c18 Jul 2020 pre-releaseNothing published for this version
-
v1.0.2-0.20190201001750-30832cc4f31201 Feb 2019 pre-releaseNothing published for this version
-
v1.0.2-0.20190127080007-346d4ae1e96f27 Jan 2019 pre-releaseNothing published for this version
-
v1.0.2-0.20190126180210-1d33bca5f3a726 Jan 2019 pre-releaseNothing published for this version