From 6e76dc96aa837bbd81ac1466d4cf9b3ecc37d39d Mon Sep 17 00:00:00 2001 From: jim teeuwen Date: Fri, 27 Jan 2012 11:51:02 +0100 Subject: [PATCH] gofix for weekly.2012-01-27 --- document.go | 4 ++-- node.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/document.go b/document.go index 3811cee..6ef83be 100644 --- a/document.go +++ b/document.go @@ -26,10 +26,10 @@ package xmlx import ( "bytes" + "code.google.com/p/go-charset/charset" "encoding/xml" "errors" "fmt" - "go-charset.googlecode.com/hg/charset" "io" "io/ioutil" "net/http" @@ -80,7 +80,7 @@ func (this *Document) SelectNodes(namespace, name string) []*Node { // Load the contents of this document from the supplied reader. func (this *Document) LoadStream(r io.Reader) (err error) { - xp := xml.NewParser(r) + xp := xml.NewDecoder(r) xp.Entity = this.Entity xp.CharsetReader = func(enc string, input io.Reader) (io.Reader, error) { return charset.NewReader(enc, input) diff --git a/node.go b/node.go index 40faeaf..a1de0ba 100644 --- a/node.go +++ b/node.go @@ -45,7 +45,7 @@ func NewNode(tid byte) *Node { // This wraps the standard xml.Unmarshal function and supplies this particular // node as the content to be unmarshalled. func (this *Node) Unmarshal(obj interface{}) error { - return xml.Unmarshal(bytes.NewBuffer(this.Bytes()), obj) + return xml.NewDecoder(bytes.NewBuffer(this.Bytes())).Decode(obj) } // Get node value as string