mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-30 01:25:30 +00:00
added XSDTime datatype
This commit is contained in:
@@ -1,17 +1,31 @@
|
||||
package xmlprovider
|
||||
|
||||
import "encoding/xml"
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers/xsdtime"
|
||||
)
|
||||
|
||||
var InvalidDateError = errors.New("Invalid date")
|
||||
|
||||
const DateLayout = "2006-01-02"
|
||||
|
||||
type KGPZDate struct {
|
||||
XMLName xml.Name `xml:"datum"`
|
||||
When string `xml:"when,attr"`
|
||||
NotBefore string `xml:"notBefore,attr"`
|
||||
NotAfter string `xml:"notAfter,attr"`
|
||||
From string `xml:"from,attr"`
|
||||
To string `xml:"to,attr"`
|
||||
XMLName xml.Name `xml:"datum"`
|
||||
DateAttributes
|
||||
Value
|
||||
}
|
||||
|
||||
type DateAttributes struct {
|
||||
When xsdtime.XSDDate `xml:"when,attr"`
|
||||
NotBefore xsdtime.XSDDate `xml:"notBefore,attr"`
|
||||
NotAfter xsdtime.XSDDate `xml:"notAfter,attr"`
|
||||
From xsdtime.XSDDate `xml:"from,attr"`
|
||||
To xsdtime.XSDDate `xml:"to,attr"`
|
||||
Cert string `xml:"cert,attr"`
|
||||
}
|
||||
|
||||
type URL struct {
|
||||
XMLName xml.Name `xml:"url"`
|
||||
Address string `xml:"address,attr"`
|
||||
|
||||
Reference in New Issue
Block a user