Skip to content

Commit

Permalink
Remove double quots from text nodes.
Browse files Browse the repository at this point in the history
The go encoder seems to encode these into the wrong entity.
Instead of encoding them as " it encodes them as &aws#34;
Riak CS has no idea what to do with these and throws a fit.
  • Loading branch information
Jason Stillwell committed Aug 28, 2015
1 parent 3b2e053 commit 639f3a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/protocol/xml/xmlutil/xml_to_struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/xml"
"io"
"sort"
"strings"
)

// A XMLNode contains the values to be encoded or decoded.
Expand Down Expand Up @@ -79,7 +80,7 @@ func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {
e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})

if node.Text != "" {
e.EncodeToken(xml.CharData([]byte(node.Text)))
e.EncodeToken(xml.CharData([]byte(strings.Replace(node.Text, `"`, "", -1))))
} else if sorted {
sortedNames := []string{}
for k := range node.Children {
Expand Down

0 comments on commit 639f3a2

Please sign in to comment.