Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Next ¶
Next returns the next token, if any, in the XML stream of d. RFC 4918 requires to ignore comments, processing instructions and directives. http://www.webdav.org/specs/rfc4918.html#property_values http://www.webdav.org/specs/rfc4918.html#xml-extensibility
Types ¶
type ActiveLock ¶
type ActiveLock struct { XMLName xml.Name `xml:"activelock"` Exclusive *struct{} `xml:"lockscope>exclusive,omitempty"` Write *struct{} `xml:"locktype>write,omitempty"` Depth string `xml:"depth"` Owner Owner `xml:"owner,omitempty"` Timeout string `xml:"timeout,omitempty"` Locktoken string `xml:"locktoken>href"` Lockroot string `xml:"lockroot>href,omitempty"` }
ActiveLock holds active lock xml data
http://www.webdav.org/specs/rfc4918.html#ELEMENT_activelock
<!ELEMENT activelock (lockscope, locktype, depth, owner?, timeout?,
locktoken?, lockroot)>
type Owner ¶
type Owner struct {
InnerXML string `xml:",innerxml"`
}
Owner captures the inner UML of a lock owner element http://www.webdav.org/specs/rfc4918.html#ELEMENT_owner
type PropertyXML ¶
type PropertyXML struct { // XMLName is the fully qualified name that identifies this property. XMLName xml.Name // Lang is an optional xml:lang attribute. Lang string `xml:"xml:lang,attr,omitempty"` // InnerXML contains the XML representation of the property value. // See http://www.webdav.org/specs/rfc4918.html#property_values // // Property values of complex type or mixed-content must have fully // expanded XML namespaces or be self-contained with according // XML namespace declarations. They must not rely on any XML // namespace declarations within the scope of the XML document, // even including the DAV: namespace. InnerXML []byte `xml:",innerxml"` }
PropertyXML represents a single DAV resource property as defined in RFC 4918. http://www.webdav.org/specs/rfc4918.html#data.model.for.resource.properties
func Escaped ¶
func Escaped(key, val string) PropertyXML
Escaped returns a new PropertyXML instance while replacing only * `&` with `&` * `<` with `<` * `>` with `>` as defined in https://www.w3.org/TR/REC-xml/#syntax:
> The ampersand character (&) and the left angle bracket (<) must not appear > in their literal form, except when used as markup delimiters, or within a > comment, a processing instruction, or a CDATA section. If they are needed > elsewhere, they must be escaped using either numeric character references > or the strings " & " and " < " respectively. The right angle > bracket (>) may be represented using the string " > ", and must, for > compatibility, be escaped using either " > " or a character reference > when it appears in the string " ]]> " in content, when that string is not > marking the end of a CDATA section.
The code ignores errors as the legacy Escaped() does TODO properly use the space
func EscapedNS ¶
func EscapedNS(namespace string, local string, val string) PropertyXML
EscapedNS returns a new PropertyXML instance while xml-escaping the value
func NotFound ¶
func NotFound(key string) PropertyXML
NotFound returns a new PropertyXML instance with an empty value
func NotFoundNS ¶
func NotFoundNS(namespace, key string) PropertyXML
NotFoundNS returns a new PropertyXML instance with the given namespace and an empty value
func Raw ¶
func Raw(key, val string) PropertyXML
Raw returns a new PropertyXML instance for the given key/value pair TODO properly use the space