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 Letter struct {
|
||||
XMLName xml.Name `xml:"letterText"`
|
||||
@@ -10,6 +13,22 @@ type Letter struct {
|
||||
Content string `xml:",innerxml"`
|
||||
}
|
||||
|
||||
func (l Letter) Keys() []any {
|
||||
return []any{l.Letter}
|
||||
}
|
||||
|
||||
func (l Letter) Type() string {
|
||||
return LETTER
|
||||
}
|
||||
|
||||
func (l Letter) String() string {
|
||||
json, err := json.Marshal(l)
|
||||
if err != nil {
|
||||
return "Cant marshal to json, Letter: " + err.Error()
|
||||
}
|
||||
return string(json)
|
||||
}
|
||||
|
||||
type Page struct {
|
||||
XMLName xml.Name `xml:"page"`
|
||||
Index int `xml:"index,attr"`
|
||||
|
||||
Reference in New Issue
Block a user