Get name space name: name with a : stuck in the middle. The part before the : is the name space identifier.
()
| 1158 | // Get name space name: name with a : stuck in the middle. |
| 1159 | // The part before the : is the name space identifier. |
| 1160 | func (d *Decoder) nsname() (name Name, ok bool) { |
| 1161 | s, ok := d.name() |
| 1162 | if !ok { |
| 1163 | return |
| 1164 | } |
| 1165 | if strings.Count(s, ":") > 1 { |
| 1166 | return name, false |
| 1167 | } else if space, local, ok := strings.Cut(s, ":"); !ok || space == "" || local == "" { |
| 1168 | name.Local = s |
| 1169 | } else { |
| 1170 | name.Space = space |
| 1171 | name.Local = local |
| 1172 | } |
| 1173 | return name, true |
| 1174 | } |
| 1175 | |
| 1176 | // Get name: /first(first|second)*/ |
| 1177 | // Do not set d.err if the name is missing (unless unexpected EOF is received): |