WriteTo writes the XML representation of the directive to the provided writer.
(w TokenWriter)
| 108 | |
| 109 | // WriteTo writes the XML representation of the directive to the provided writer. |
| 110 | func (d *Directive) WriteTo(w TokenWriter) error { |
| 111 | if _, err := w.WriteString("<!DOCTYPE"); err != nil { |
| 112 | return err |
| 113 | } |
| 114 | if _, err := w.Write(d.Data); err != nil { |
| 115 | return err |
| 116 | } |
| 117 | if err := w.WriteByte('>'); err != nil { |
| 118 | return err |
| 119 | } |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | // Comment represents a comment token (e.g., <!-- comment -->). |
| 124 | // When obtained from [Decoder], the bytes in the Data field are actual only |