]> Cypherpunks repositories - gostls13.git/commit
xml: handle tag paths through the same element
authorGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 19 Jan 2011 20:43:58 +0000 (15:43 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 19 Jan 2011 20:43:58 +0000 (15:43 -0500)
commitc52ad23461953a8017199fe0a6fa78ba486ec2ef
treebc868e7424e7297f7772c8dff0752770613447f3
parentb99a6d465a5a08ea5217d72e8e7a6202b80320d2
xml: handle tag paths through the same element

With the current implementation, xml unmarshalling
will silently fail to unmarshal any paths passing
through the same element, such as:

type T struct {
A string "dummy>a"
B string "dummy>b"
}

This change tweaks the algorithm so that this works
correctly.

Also, using paths that would cause the same element to
unmarshal twice will error out ahead of time explaining
the problem, rather than silently misbehaving.

R=rsc
CC=golang-dev
https://golang.org/cl/4082041
src/pkg/xml/read.go
src/pkg/xml/read_test.go