diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
commit | 9464a0c36318f8a801c07d6874bd0cea40f12504 (patch) | |
tree | f0178491c19d4f1ebc7b92eede86690998466480 /src/pkg/xml/marshal.go | |
parent | ba9fda6068cfadd42db0b152fdca7e8b67aaf77d (diff) | |
parent | 5ff4c17907d5b19510a62e08fd8d3b11e62b431d (diff) | |
download | golang-9464a0c36318f8a801c07d6874bd0cea40f12504.tar.gz |
Merge commit 'upstream/60' into debian-sid
Diffstat (limited to 'src/pkg/xml/marshal.go')
-rw-r--r-- | src/pkg/xml/marshal.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/xml/marshal.go b/src/pkg/xml/marshal.go index 2ac03a91e..ea421c1b1 100644 --- a/src/pkg/xml/marshal.go +++ b/src/pkg/xml/marshal.go @@ -14,10 +14,10 @@ import ( ) const ( - // A generic XML header suitable for use with the output of Marshal and MarshalIndent. - // This is not automatically added to any output of this package, it is provided as a - // convenience. - Header = `<?xml version="1.0" encoding="UTF-8">\n` + // A generic XML header suitable for use with the output of Marshal and + // MarshalIndent. This is not automatically added to any output of this + // package, it is provided as a convenience. + Header = `<?xml version="1.0" encoding="UTF-8"?>` + "\n" ) // A Marshaler can produce well-formatted XML representing its internal state. @@ -177,7 +177,7 @@ func (p *printer) marshalValue(val reflect.Value, name string) os.Error { case "": case "chardata": if tk := f.Type.Kind(); tk == reflect.String { - p.Write([]byte(val.Field(i).String())) + Escape(p, []byte(val.Field(i).String())) } else if tk == reflect.Slice { if elem, ok := val.Field(i).Interface().([]byte); ok { Escape(p, elem) |