From e0fdc48cf7aa161c8d696c085084e9085f935d72 Mon Sep 17 00:00:00 2001 From: jim teeuwen Date: Mon, 23 Nov 2009 17:50:29 +0100 Subject: [PATCH] modified: src/document.go --- src/document.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/document.go b/src/document.go index beb0101..7610c0f 100644 --- a/src/document.go +++ b/src/document.go @@ -55,6 +55,7 @@ type Document struct { StandAlone string; SaveDocType bool; Root *Node; + Entity map[string]string; } func New() *Document { @@ -63,6 +64,7 @@ func New() *Document { Encoding: "utf-8", StandAlone: "yes", SaveDocType: true, + Entity: make(map[string]string) } } @@ -71,7 +73,6 @@ func (this *Document) String() string { return s; } - func (this *Document) SelectNode(namespace, name string) *Node { return this.Root.SelectNode(namespace, name); } @@ -85,6 +86,8 @@ func (this *Document) SelectNodes(namespace, name string) []*Node { // ***************************************************************************** func (this *Document) LoadString(s string) (err os.Error) { xp := xml.NewParser(strings.NewReader(s)); + xp.Entity = this.Entity; + this.Root = NewNode(NT_ROOT); ct := this.Root;