MCPcopy Create free account
hub / github.com/antchfx/xmlquery / createParser

Function createParser

parse.go:118–134  ·  view source on GitHub ↗
(r io.Reader)

Source from the content-addressed store, hash-verified

116}
117
118func createParser(r io.Reader) *parser {
119 reader := newCachedReader(bufio.NewReader(r))
120 p := &parser{
121 decoder: xml.NewDecoder(reader),
122 doc: &Node{Type: DocumentNode},
123 level: 0,
124 reader: reader,
125 currentLine: 0,
126 lastProcessedPos: 0,
127 lineStarts: nil,
128 }
129 if p.decoder.CharsetReader == nil {
130 p.decoder.CharsetReader = charset.NewReaderLabel
131 }
132 p.prev = p.doc
133 return p
134}
135
136// updateLineNumber scans only new cached data for newlines to update current line position
137func (p *parser) updateLineNumber() {

Callers 2

ParseWithOptionsFunction · 0.85

Calls 1

newCachedReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…