WriteTo writes the XML representation of the comment to the provided writer.
(w TokenWriter)
| 134 | |
| 135 | // WriteTo writes the XML representation of the comment to the provided writer. |
| 136 | func (c *Comment) WriteTo(w TokenWriter) error { |
| 137 | if _, err := w.WriteString("<!--"); err != nil { |
| 138 | return err |
| 139 | } |
| 140 | if _, err := w.Write(c.Data); err != nil { |
| 141 | return err |
| 142 | } |
| 143 | if _, err := w.WriteString("-->"); err != nil { |
| 144 | return err |
| 145 | } |
| 146 | return nil |
| 147 | } |
| 148 | |
| 149 | // ProcInst represents a processing instruction token (e.g., <?xml version="1.0"?>). |
| 150 | // When obtained from [Decoder], the bytes in the Target and Inst fields are actual only |