Documentation
¶
Overview ¶
Package xml minifies XML1.0 following the specifications at http://www.w3.org/TR/xml/.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var AttrRevEntitiesMap = map[byte][]byte{ '\t': []byte("	"), '\n': []byte(" "), '\r': []byte(" "), }
AttrRevEntitiesMap keeps whitespace character references; decoding them to literal tab/LF/CR would let attribute-value normalization collapse them to a space.
var EntitiesMap = map[string][]byte{ "apos": []byte("'"), "quot": []byte("\""), }
EntitiesMap are all named character entities.
var TextRevEntitiesMap = map[byte][]byte{ '<': []byte("<"), '>': []byte(">"), '&': []byte("&"), '\t': []byte("	"), '\n': []byte(" "), '\r': []byte(" "), }
TextRevEntitiesMap is a map of escapes. It keeps whitespace character references; decoding them to literal tab/LF/CR would let text whitespace normalization collapse them to a space.
Functions ¶
Types ¶
type TokenBuffer ¶
type TokenBuffer struct {
// contains filtered or unexported fields
}
TokenBuffer is a buffer that allows for token look-ahead.
func NewTokenBuffer ¶
func NewTokenBuffer(l *xml.Lexer) *TokenBuffer
NewTokenBuffer returns a new TokenBuffer.
func (*TokenBuffer) Peek ¶
func (z *TokenBuffer) Peek(pos int) *Token
Peek returns the ith element and possibly does an allocation. Peeking past an error will panic.
func (*TokenBuffer) Shift ¶
func (z *TokenBuffer) Shift() *Token
Shift returns the first element and advances position.