A TokenReader is anything that can decode a stream of XML tokens, including a Decoder. When Token encounters an error or end-of-file condition after successfully reading a token, it returns the token. It may return the (non-nil) error from the same call or return the error (and a nil token) from a
| 140 | // nil error. Callers should treat a return of nil, nil as indicating that |
| 141 | // nothing happened; in particular it does not indicate EOF. |
| 142 | type TokenReader interface { |
| 143 | Token() (Token, error) |
| 144 | } |
| 145 | |
| 146 | // A Decoder represents an XML parser reading a particular input stream. |
| 147 | // The parser assumes that its input is encoded in UTF-8. |