Generate PROPFIND request body

Instead of a hardcoded string, generate it with encoding/xml.
This commit is contained in:
Simon Ser
2020-01-14 20:00:54 +01:00
parent 6f9ff62747
commit 87a88d6723
4 changed files with 47 additions and 10 deletions

View File

@@ -13,6 +13,11 @@ type RawXMLValue struct {
children []RawXMLValue
}
// NewRawXMLElement creates a new RawXMLValue for an element.
func NewRawXMLElement(name xml.Name, attr []xml.Attr, children []RawXMLValue) *RawXMLValue {
return &RawXMLValue{tok: xml.StartElement{name, attr}, children: children}
}
// UnmarshalXML implements xml.Unmarshaler.
func (val *RawXMLValue) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
val.tok = start