[#3896bk] Better support for XML documents

This commit is contained in:
Dane Everitt
2019-12-01 15:40:08 -08:00
parent 35cdff904f
commit e1435bfe8f
2 changed files with 19 additions and 1 deletions

View File

@@ -162,7 +162,14 @@ func (f *ConfigurationFile) parseXmlFile(path string) error {
// Iterate over the elements we found and update their values.
for _, element := range doc.FindElements(path) {
element.SetText(string(value))
if xmlValueMatchRegex.Match(value) {
k := xmlValueMatchRegex.ReplaceAllString(string(value), "$1")
v := xmlValueMatchRegex.ReplaceAllString(string(value), "$2")
element.CreateAttr(k, v)
} else {
element.SetText(string(value))
}
}
}