diff --git a/go.mod b/go.mod index 50db9e2d4..872012a94 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( require ( github.com/PaesslerAG/jsonpath v0.1.1 github.com/ajeddeloh/go-json v0.0.0-20200220154158-5ae607161559 // indirect - github.com/antchfx/xmlquery v1.3.17 + github.com/antchfx/xmlquery v1.3.18 github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 github.com/cenkalti/backoff/v4 v4.2.1 diff --git a/go.sum b/go.sum index 343f643e7..7a9a73f66 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/ajeddeloh/go-json v0.0.0-20200220154158-5ae607161559 h1:4SPQljF/GJ8Q+ github.com/ajeddeloh/go-json v0.0.0-20200220154158-5ae607161559/go.mod h1:otnto4/Icqn88WCcM4bhIJNSgsh9VLBuspyyCfvof9c= github.com/antchfx/xmlquery v1.3.17 h1:d0qWjPp/D+vtRw7ivCwT5ApH/3CkQU8JOeo3245PpTk= github.com/antchfx/xmlquery v1.3.17/go.mod h1:Afkq4JIeXut75taLSuI31ISJ/zeq+3jG7TunF7noreA= +github.com/antchfx/xmlquery v1.3.18 h1:FSQ3wMuphnPPGJOFhvc+cRQ2CT/rUj4cyQXkJcjOwz0= +github.com/antchfx/xmlquery v1.3.18/go.mod h1:Afkq4JIeXut75taLSuI31ISJ/zeq+3jG7TunF7noreA= github.com/antchfx/xpath v1.2.4 h1:dW1HB/JxKvGtJ9WyVGJ0sIoEcqftV3SqIstujI+B9XY= github.com/antchfx/xpath v1.2.4/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= github.com/ashcrow/osrelease v0.0.0-20180626175927-9b292693c55c h1:icme0QhxrgZOxTBnT6K8dfGLwbKWSOVwPB95XTbo8Ws= diff --git a/vendor/github.com/antchfx/xmlquery/node.go b/vendor/github.com/antchfx/xmlquery/node.go index fb4912d55..207892ae7 100644 --- a/vendor/github.com/antchfx/xmlquery/node.go +++ b/vendor/github.com/antchfx/xmlquery/node.go @@ -80,6 +80,13 @@ func WithoutComments() OutputOption { } } +// WithPreserveSpace will preserve spaces in output +func WithPreserveSpace() OutputOption { + return func(oc *outputConfiguration) { + oc.preserveSpaces = true + } +} + func newXMLName(name string) xml.Name { if i := strings.IndexByte(name, ':'); i > 0 { return xml.Name{ @@ -216,8 +223,8 @@ func (n *Node) OutputXMLWithOptions(opts ...OutputOption) string { for _, opt := range opts { opt(config) } - - preserveSpaces := calculatePreserveSpaces(n, false) + pastPreserveSpaces := config.preserveSpaces + preserveSpaces := calculatePreserveSpaces(n, pastPreserveSpaces) var b strings.Builder if config.printSelf && n.Type != DocumentNode { outputXML(&b, n, preserveSpaces, config) diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ef6f53a0..058331c71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,7 +7,7 @@ github.com/PaesslerAG/jsonpath # github.com/ajeddeloh/go-json v0.0.0-20200220154158-5ae607161559 ## explicit github.com/ajeddeloh/go-json -# github.com/antchfx/xmlquery v1.3.17 +# github.com/antchfx/xmlquery v1.3.18 ## explicit; go 1.14 github.com/antchfx/xmlquery # github.com/antchfx/xpath v1.2.4