Debian Codegraph @

RELEASE_NOTES.md

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