NewDecoder creates a new XML parser reading from r. If r does not implement io.ByteReader, NewDecoder will do its own buffering.
(r io.Reader)
| 237 | // If r does not implement io.ByteReader, NewDecoder will |
| 238 | // do its own buffering. |
| 239 | func NewDecoder(r io.Reader) *Decoder { |
| 240 | d := &Decoder{ |
| 241 | ns: make(map[string]string), |
| 242 | nextByte: -1, |
| 243 | line: 1, |
| 244 | Strict: true, |
| 245 | } |
| 246 | d.switchToReader(r) |
| 247 | return d |
| 248 | } |
| 249 | |
| 250 | // Token returns the next XML token in the input stream. |
| 251 | // At the end of the input stream, Token returns nil, io.EOF. |