modified: src/document.go
This commit is contained in:
parent
aa1df539c3
commit
e0fdc48cf7
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue