(ctx *xmlContext)
| 80 | } |
| 81 | |
| 82 | func (c *xmlStartElement) xml(ctx *xmlContext) string { |
| 83 | b := bytes.Buffer{} |
| 84 | b.WriteString(strings.Repeat(ctx.tab, ctx.indent)) |
| 85 | b.WriteRune('<') |
| 86 | b.WriteString(c.name.get()) |
| 87 | if ns, ok := ctx.stack.head().(*xmlStartNamespace); ok { |
| 88 | b.WriteRune('\n') |
| 89 | b.WriteString(strings.Repeat(ctx.tab, ctx.indent+2)) |
| 90 | b.WriteString(`xmlns:`) |
| 91 | b.WriteString(ns.namespacePrefix.get()) |
| 92 | b.WriteString(`="`) |
| 93 | b.WriteString(ns.namespaceURI.get()) |
| 94 | b.WriteString(`" `) |
| 95 | } |
| 96 | b.WriteString(c.attributes.xml(ctx)) |
| 97 | b.WriteRune('>') |
| 98 | c.updateContext(ctx) |
| 99 | return b.String() |
| 100 | } |
| 101 | |
| 102 | func (c *xmlStartElement) encode() []byte { |
| 103 | return encodeChunk(resXMLStartElementType, func(w binary.Writer) { |
nothing calls this directly
no test coverage detected