Finalized resolver

This commit is contained in:
Simon Martens
2025-01-03 18:57:22 +01:00
parent e6a77ab557
commit 9ca2ebb75f
10 changed files with 225 additions and 64 deletions

View File

@@ -2,18 +2,16 @@ package xmlmodels
import "encoding/xml"
type Reference struct {
Ref string `xml:"ref,attr"`
Category string `xml:"kat,attr"`
Unsicher bool `xml:"unsicher,attr"`
Value
}
type AgentRef struct {
XMLName xml.Name `xml:"akteur"`
Reference
}
func (ar AgentRef) Name() string {
var x Agent
return x.Name()
}
type IssueRef struct {
XMLName xml.Name `xml:"stueck"`
Nr int `xml:"nr,attr"`
@@ -24,24 +22,49 @@ type IssueRef struct {
Reference // Nicht im Schema
}
func (ir IssueRef) Name() string {
var x Issue
return x.Name()
}
type PlaceRef struct {
XMLName xml.Name `xml:"ort"`
Reference
}
func (pr PlaceRef) Name() string {
var x Place
return x.Name()
}
type CategoryRef struct {
XMLName xml.Name `xml:"kategorie"`
Reference
}
func (cr CategoryRef) Name() string {
var x Category
return x.Name()
}
type WorkRef struct {
XMLName xml.Name `xml:"werk"`
Page string `xml:"s,attr"`
Reference
}
func (wr WorkRef) Name() string {
var x Work
return x.Name()
}
type PieceRef struct {
XMLName xml.Name `xml:"beitrag"`
Page string `xml:"s,attr"`
Reference
}
func (pr PieceRef) Name() string {
var x Piece
return x.Name()
}