MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / translate

Method translate

server/webdav/internal/xml/xml.go:332–348  ·  view source on GitHub ↗

Apply name space translation to name n. The default name space (for Space=="") applies only to element names, not to attribute names.

(n *Name, isElementName bool)

Source from the content-addressed store, hash-verified

330// The default name space (for Space=="")
331// applies only to element names, not to attribute names.
332func (d *Decoder) translate(n *Name, isElementName bool) {
333 switch {
334 case n.Space == "xmlns":
335 return
336 case n.Space == "" && !isElementName:
337 return
338 case n.Space == "xml":
339 n.Space = xmlURL
340 case n.Space == "" && n.Local == "xmlns":
341 return
342 }
343 if v, ok := d.ns[n.Space]; ok {
344 n.Space = v
345 } else if n.Space == "" {
346 n.Space = d.DefaultSpace
347 }
348}
349
350func (d *Decoder) switchToReader(r io.Reader) {
351 // Get efficient byte at a time reader.

Callers 1

TokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected