mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 09:15:33 +00:00
Finsihed xml model & small bugfixes
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user