Finsihed xml model & small bugfixes

This commit is contained in:
Simon Martens
2025-03-05 18:56:34 +01:00
parent e19fd47c17
commit e839bbebe8
46 changed files with 8928 additions and 136 deletions

View File

@@ -1,6 +1,9 @@
package xmlmodels
import "encoding/xml"
import (
"encoding/json"
"encoding/xml"
)
type Tradition struct {
XMLName xml.Name `xml:"letterTradition"`
@@ -8,6 +11,22 @@ type Tradition struct {
Apps []App `xml:"app"`
}
func (t Tradition) Keys() []any {
return []any{t.Letter}
}
func (t Tradition) Type() string {
return TRADITION
}
func (t Tradition) String() string {
data, err := json.Marshal(t)
if err != nil {
return "Cant marshal to json, Tradition: " + err.Error()
}
return string(data)
}
type App struct {
Reference int `xml:"ref,attr"`
Content string `xml:",innerxml"`