From e5f837f91cc2f147c9d220883ad4d924d53e87fc Mon Sep 17 00:00:00 2001 From: glen newton Date: Sat, 17 Jun 2017 09:50:09 -0400 Subject: [PATCH] Fixed XML root name clash from issue #20 --- extractor.go | 4 +++- source.go | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extractor.go b/extractor.go index 98e81fa..331ba69 100644 --- a/extractor.go +++ b/extractor.go @@ -30,6 +30,8 @@ type Extractor struct { progress bool } +const RootName = "ChidleyRoot314159" + func (ex *Extractor) extract() error { ex.globalTagAttributes = make(map[string]([]*FQN)) ex.globalTagAttributesMap = make(map[string]bool) @@ -39,7 +41,7 @@ func (ex *Extractor) extract() error { decoder := xml.NewDecoder(ex.reader) ex.root = new(Node) - ex.root.initialize("root", "", "", nil) + ex.root.initialize(RootName, "", "", nil) ex.hasStartElements = false diff --git a/source.go b/source.go index a017921..deae982 100644 --- a/source.go +++ b/source.go @@ -13,7 +13,6 @@ type Source interface { newSource(name string) error getName() string getReader() io.Reader - copySource() (Source, error) } type GenericSource struct {