gofix for weekly.2012-01-27
This commit is contained in:
parent
b5c33469fa
commit
6e76dc96aa
|
@ -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)
|
||||
|
|
2
node.go
2
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
|
||||
|
|
Loading…
Reference in New Issue