MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / WriteTo

Method WriteTo

xmlparser/tokens.go:166–187  ·  view source on GitHub ↗

WriteTo writes the XML representation of the processing instruction to the provided writer.

(w TokenWriter)

Source from the content-addressed store, hash-verified

164
165// WriteTo writes the XML representation of the processing instruction to the provided writer.
166func (p *ProcInst) WriteTo(w TokenWriter) error {
167 if _, err := w.WriteString("<?"); err != nil {
168 return err
169 }
170 if _, err := w.Write(p.Target); err != nil {
171 return err
172 }
173 if len(p.Inst) > 0 {
174 if !isSpace(p.Inst[0]) {
175 if err := w.WriteByte(' '); err != nil {
176 return err
177 }
178 }
179 if _, err := w.Write(p.Inst); err != nil {
180 return err
181 }
182 }
183 if _, err := w.WriteString("?>"); err != nil {
184 return err
185 }
186 return nil
187}
188
189// Text represents a text token.
190// CData indicates whether the text is a CDATA section.

Callers

nothing calls this directly

Calls 3

isSpaceFunction · 0.85
WriteByteMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected