Debian Codegraph @

RELEASE_NOTES.md

raw
1 Release 1.8.1
2 =============
3
4 **Fixes**
5
6 * Fixed a panic-causing bug in all Remove functions.
7
8 Release 1.8.0
9 =============
10
11 **Changes**
12
13 * Added the `Remove` function to all token types, allowing for the easy
14 removal of a token from its parent element.
15
16 **Fixes**
17
18 * Cleaned up several comments for clarity and typo corrections.
19
20 Release 1.7.1
21 =============
22
23 **Changes**
24
25 * Improve efficiency of `Element.Text` and `Element.Tail`.
26
27 Release 1.7.0
28 =============
29
30 **Breaking changes**
31
32 * To address a security issue, it was necessary to add a `MaxDepth` option to
33 `ReadSettings` to limit the depth of XML trees during parsing. A generous
34 default value of 1024 was chosen to avoid breaking most existing code.
35 However, if your code is processing XML hierarchies with a depth greater
36 than 1024, you will need to assign your `Document` a `ReadSettings` that has
37 a `MaxDepth` set to a higher value.
38
39 **Security Fixes**
40
41 * Limited the depth of XML trees processed by all `ReadFrom` functions during
42 parsing.
43 * Fixed a `CompilePath` index-out-of-range panic that could be caused by a
44 missing path filter key.
45 * Sanitized the contents of XML text, comment, ProcInst and Directive tokens
46 provided by the user.
47
48
49 Release 1.6.0
50 =============
51
52 **Changes**
53
54 * Added new iterator versions of existing functions that return slices of
55 `Element` pointers: `ChildElementsSeq`, `SelectElementsSeq`,
56 `FindElementsSeq`, and `FindElementsPathSeq`.
57 * Improved performance of functions that return a single element.
58 * Because of its use of iterators, this package now requires go 1.23 or later.
59
60 Release 1.5.1
61 =============
62
63 **Fixes**
64
65 * Fixed a bug in `InsertChildAt`.
66
67 Release 1.5.0
68 =============
69
70 **Changes**
71
72 * Added `Element` function `CreateChild`, which calls a continuation function
73 after creating and adding a child element.
74
75 **Fixes**
76
77 * Removed a potential conflict between two `ReadSettings` values. When
78 `AttrSingleQuote` is true, `CanonicalAttrVal` is forced to be false.
79
80 Release 1.4.1
81 =============
82
83 **Changes**
84
85 * Minimal go version updated to 1.21.
86 * Default-initialized CharsetReader causes same result as NewDocument().
87 * When reading an XML document, attributes are parsed more efficiently.
88
89 Release v1.4.0
90 ==============
91
92 **New Features**
93
94 * Add `AutoClose` option to `ReadSettings`.
95 * Add `ValidateInput` to `ReadSettings`.
96 * Add `NotNil` function to `Element`.
97 * Add `NextSibling` and `PrevSibling` functions to `Element`.
98
99 Release v1.3.0
100 ==============
101
102 **New Features**
103
104 * Add support for double-quotes in filter path queries.
105 * Add `PreserveDuplicateAttrs` to `ReadSettings`.
106 * Add `ReindexChildren` to `Element`.
107
108 Release v1.2.0
109 ==============
110
111 **New Features**
112
113 * Add the ability to write XML fragments using Token WriteTo functions.
114 * Add the ability to re-indent an XML element as though it were the root of
115 the document.
116 * Add a ReadSettings option to preserve CDATA blocks when reading and XML
117 document.
118
119 Release v1.1.4
120 ==============
121
122 **New Features**
123
124 * Add the ability to preserve whitespace in leaf elements during indent.
125 * Add the ability to suppress a document-trailing newline during indent.
126 * Add choice of XML attribute quoting style (single-quote or double-quote).
127
128 **Removed Features**
129
130 * Removed the CDATA preservation change introduced in v1.1.3. It was
131 implemented in a way that broke the ability to process XML documents
132 encoded using non-UTF8 character sets.
133
134 Release v1.1.3
135 ==============
136
137 * XML reads now preserve CDATA sections instead of converting them to
138 standard character data.
139
140 Release v1.1.2
141 ==============
142
143 * Fixed a path parsing bug.
144 * The `Element.Text` function now handles comments embedded between
145 character data spans.
146
147 Release v1.1.1
148 ==============
149
150 * Updated go version in `go.mod` to 1.20
151
152 Release v1.1.0
153 ==============
154
155 **New Features**
156
157 * New attribute helpers.
158 * Added the `Element.SortAttrs` method, which lexicographically sorts an
159 element's attributes by key.
160 * New `ReadSettings` properties.
161 * Added `Entity` for the support of custom entity maps.
162 * New `WriteSettings` properties.
163 * Added `UseCRLF` to allow the output of CR-LF newlines instead of the
164 default LF newlines. This is useful on Windows systems.
165 * Additional support for text and CDATA sections.
166 * The `Element.Text` method now returns the concatenation of all consecutive
167 character data tokens immediately following an element's opening tag.
168 * Added `Element.SetCData` to replace the character data immediately
169 following an element's opening tag with a CDATA section.
170 * Added `Element.CreateCData` to create and add a CDATA section child
171 `CharData` token to an element.
172 * Added `Element.CreateText` to create and add a child text `CharData` token
173 to an element.
174 * Added `NewCData` to create a parentless CDATA section `CharData` token.
175 * Added `NewText` to create a parentless text `CharData`
176 token.
177 * Added `CharData.IsCData` to detect if the token contains a CDATA section.
178 * Added `CharData.IsWhitespace` to detect if the token contains whitespace
179 inserted by one of the document Indent functions.
180 * Modified `Element.SetText` so that it replaces a run of consecutive
181 character data tokens following the element's opening tag (instead of just
182 the first one).
183 * New "tail text" support.
184 * Added the `Element.Tail` method, which returns the text immediately
185 following an element's closing tag.
186 * Added the `Element.SetTail` method, which modifies the text immediately
187 following an element's closing tag.
188 * New element child insertion and removal methods.
189 * Added the `Element.InsertChildAt` method, which inserts a new child token
190 before the specified child token index.
191 * Added the `Element.RemoveChildAt` method, which removes the child token at
192 the specified child token index.
193 * New element and attribute queries.
194 * Added the `Element.Index` method, which returns the element's index within
195 its parent element's child token list.
196 * Added the `Element.NamespaceURI` method to return the namespace URI
197 associated with an element.
198 * Added the `Attr.NamespaceURI` method to return the namespace URI
199 associated with an element.
200 * Added the `Attr.Element` method to return the element that an attribute
201 belongs to.
202 * New Path filter functions.
203 * Added `[local-name()='val']` to keep elements whose unprefixed tag matches
204 the desired value.
205 * Added `[name()='val']` to keep elements whose full tag matches the desired
206 value.
207 * Added `[namespace-prefix()='val']` to keep elements whose namespace prefix
208 matches the desired value.
209 * Added `[namespace-uri()='val']` to keep elements whose namespace URI
210 matches the desired value.
211
212 **Bug Fixes**
213
214 * A default XML `CharSetReader` is now used to prevent failed parsing of XML
215 documents using certain encodings.
216 ([Issue](https://github.com/beevik/etree/issues/53)).
217 * All characters are now properly escaped according to XML parsing rules.
218 ([Issue](https://github.com/beevik/etree/issues/55)).
219 * The `Document.Indent` and `Document.IndentTabs` functions no longer insert
220 empty string `CharData` tokens.
221
222 **Deprecated**
223
224 * `Element`
225 * The `InsertChild` method is deprecated. Use `InsertChildAt` instead.
226 * The `CreateCharData` method is deprecated. Use `CreateText` instead.
227 * `CharData`
228 * The `NewCharData` method is deprecated. Use `NewText` instead.
229
230
231 Release v1.0.1
232 ==============
233
234 **Changes**
235
236 * Added support for absolute etree Path queries. An absolute path begins with
237 `/` or `//` and begins its search from the element's document root.
238 * Added [`GetPath`](https://godoc.org/github.com/beevik/etree#Element.GetPath)
239 and [`GetRelativePath`](https://godoc.org/github.com/beevik/etree#Element.GetRelativePath)
240 functions to the [`Element`](https://godoc.org/github.com/beevik/etree#Element)
241 type.
242
243 **Breaking changes**
244
245 * A path starting with `//` is now interpreted as an absolute path.
246 Previously, it was interpreted as a relative path starting from the element
247 whose
248 [`FindElement`](https://godoc.org/github.com/beevik/etree#Element.FindElement)
249 method was called. To remain compatible with this release, all paths
250 prefixed with `//` should be prefixed with `.//` when called from any
251 element other than the document's root.
252 * [**edit 2/1/2019**]: Minor releases should not contain breaking changes.
253 Even though this breaking change was very minor, it was a mistake to include
254 it in this minor release. In the future, all breaking changes will be
255 limited to major releases (e.g., version 2.0.0).
256
257 Release v1.0.0
258 ==============
259
260 Initial release.