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)
| 340 | // The default name space (for Space=="") |
| 341 | // applies only to element names, not to attribute names. |
| 342 | func (d *Decoder) translate(n *Name, isElementName bool) { |
| 343 | switch { |
| 344 | case n.Space == xmlnsPrefix: |
| 345 | return |
| 346 | case n.Space == "" && !isElementName: |
| 347 | return |
| 348 | case n.Space == xmlPrefix: |
| 349 | n.Space = xmlURL |
| 350 | case n.Space == "" && n.Local == xmlnsPrefix: |
| 351 | return |
| 352 | } |
| 353 | if v, ok := d.ns[n.Space]; ok { |
| 354 | n.Space = v |
| 355 | } else if n.Space == "" { |
| 356 | n.Space = d.DefaultSpace |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | func (d *Decoder) switchToReader(r io.Reader) { |
| 361 | // Get efficient byte at a time reader. |
no outgoing calls
no test coverage detected