Get name space name: name with a : stuck in the middle. The part before the : is the name space identifier.
()
| 1137 | // Get name space name: name with a : stuck in the middle. |
| 1138 | // The part before the : is the name space identifier. |
| 1139 | func (d *Decoder) nsname() (name Name, ok bool) { |
| 1140 | s, ok := d.name() |
| 1141 | if !ok { |
| 1142 | return |
| 1143 | } |
| 1144 | i := strings.Index(s, ":") |
| 1145 | if i < 0 { |
| 1146 | name.Local = s |
| 1147 | } else { |
| 1148 | name.Space = s[0:i] |
| 1149 | name.Local = s[i+1:] |
| 1150 | } |
| 1151 | return name, true |
| 1152 | } |
| 1153 | |
| 1154 | // Get name: /first(first|second)*/ |
| 1155 | // Do not set d.err if the name is missing (unless unexpected EOF is received): |