aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/encoding/xml/read.go
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2012-02-22 23:37:57 -0200
committerGustavo Niemeyer <gustavo@niemeyer.net>2012-02-22 23:37:57 -0200
commit133c6bf77fffcbfa38ed58cf06808b38bbc374e0 (patch)
tree8724037fc287cc53ad28278187770f7c13767f70 /src/pkg/encoding/xml/read.go
parentfea7f07e560b3a8dcc16c89f683eb907762fad6f (diff)
downloadgo-133c6bf77fffcbfa38ed58cf06808b38bbc374e0.tar.xz
encoding/xml: move Unmarshal example to function
This also fixes MarshalIndent's example after the recent formatting convention changes. Fixes #2831. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5671062
Diffstat (limited to 'src/pkg/encoding/xml/read.go')
-rw-r--r--src/pkg/encoding/xml/read.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/pkg/encoding/xml/read.go b/src/pkg/encoding/xml/read.go
index b5a3426a32..7f5601a7ad 100644
--- a/src/pkg/encoding/xml/read.go
+++ b/src/pkg/encoding/xml/read.go
@@ -25,58 +25,6 @@ import (
// slice, or string. Well-formed data that does not fit into v is
// discarded.
//
-// For example, given these definitions:
-//
-// type Email struct {
-// Where string `xml:",attr"`
-// Addr string
-// }
-//
-// type Result struct {
-// XMLName xml.Name `xml:"result"`
-// Name string
-// Phone string
-// Email []Email
-// Groups []string `xml:"group>value"`
-// }
-//
-// result := Result{Name: "name", Phone: "phone", Email: nil}
-//
-// unmarshalling the XML input
-//
-// <result>
-// <email where="home">
-// <addr>gre@example.com</addr>
-// </email>
-// <email where='work'>
-// <addr>gre@work.com</addr>
-// </email>
-// <name>Grace R. Emlin</name>
-// <group>
-// <value>Friends</value>
-// <value>Squash</value>
-// </group>
-// <address>123 Main Street</address>
-// </result>
-//
-// via Unmarshal(data, &result) is equivalent to assigning
-//
-// r = Result{
-// xml.Name{Local: "result"},
-// "Grace R. Emlin", // name
-// "phone", // no phone given
-// []Email{
-// Email{"home", "gre@example.com"},
-// Email{"work", "gre@work.com"},
-// },
-// []string{"Friends", "Squash"},
-// }
-//
-// Note that the field r.Phone has not been modified and
-// that the XML <address> element was discarded. Also, the field
-// Groups was assigned considering the element path provided in the
-// field tag.
-//
// Because Unmarshal uses the reflect package, it can only assign
// to exported (upper case) fields. Unmarshal uses a case-sensitive
// comparison to match XML element names to tag values and struct