Bump reva to commit after ldap bump

Fixes build
This commit is contained in:
Ralf Haferkamp
2025-02-20 09:24:08 +01:00
parent 6b08fa51ee
commit 26cf0255d0
11 changed files with 120 additions and 46 deletions
+13
View File
@@ -1,3 +1,16 @@
Release 1.5.0
=============
**Changes**
* Added `Element` function `CreateChild`, which calls a continuation function
after creating and adding a child element.
**Fixes**
* Removed a potential conflict between two `ReadSettings` values. When
`AttrSingleQuote` is true, `CanonicalAttrVal` is forced to be false.
Release 1.4.1
=============
+26 -4
View File
@@ -113,7 +113,8 @@ type WriteSettings struct {
// CanonicalAttrVal forces the production of XML character references for
// attribute value characters &, < and ". If false, XML character
// references are also produced for > and '. Default: false.
// references are also produced for > and '. Ignored when AttrSingleQuote
// is true. Default: false.
CanonicalAttrVal bool
// AttrSingleQuote causes attributes to use single quotes (attr='example')
@@ -751,13 +752,34 @@ func (e *Element) findTermCharDataIndex(start int) int {
}
// CreateElement creates a new element with the specified tag (i.e., name) and
// adds it as the last child token of this element. The tag may include a
// prefix followed by a colon.
// adds it as the last child of element 'e'. The tag may include a prefix
// followed by a colon.
func (e *Element) CreateElement(tag string) *Element {
space, stag := spaceDecompose(tag)
return newElement(space, stag, e)
}
// CreateChild performs the same task as CreateElement but calls a
// continuation function after the child element is created, allowing
// additional actions to be performed on the child element before returning.
//
// This method of element creation is particularly useful when building nested
// XML documents from code. For example:
//
// org := doc.CreateChild("organization", func(e *Element) {
// e.CreateComment("Mary")
// e.CreateChild("person", func(e *Element) {
// e.CreateAttr("name", "Mary")
// e.CreateAttr("age", "30")
// e.CreateAttr("hair", "brown")
// })
// })
func (e *Element) CreateChild(tag string, cont func(e *Element)) *Element {
child := e.CreateElement(tag)
cont(child)
return child
}
// AddChild adds the token 't' as the last child of the element. If token 't'
// was already the child of another element, it is first removed from its
// parent element.
@@ -1463,7 +1485,7 @@ func (a *Attr) WriteTo(w Writer, s *WriteSettings) {
w.WriteString(`="`)
}
var m escapeMode
if s.CanonicalAttrVal {
if s.CanonicalAttrVal && !s.AttrSingleQuote {
m = escapeCanonicalAttr
} else {
m = escapeNormal