Esempio n. 1
0
func (d *XmlDataOutput) writeHeader() error {
	return d.writeTokens([]xml.Token{
		xml.ProcInst{Target: "xml", Inst: []byte(`version="1.0" encoding="utf-8"`)},
		xml.Directive(`DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd"`),
		xml.Comment(`Round Robin Database Dump`),
		xml.StartElement{Name: xml.Name{Local: d.tag}},
	})
}
Esempio n. 2
0
package xml

import (
	"encoding/xml"
	"strings"
	"time"
)

var indentation = strings.Repeat(" ", 4)

var procInst = xml.ProcInst{
	Target: "xml",
	Inst:   []byte(`version="1.0" encoding="UTF-8"`),
}

var doctype = xml.Directive([]byte(
	`DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"`))

var plistStartElement = xml.StartElement{
	Name: xml.Name{"", "plist"},
	Attr: []xml.Attr{xml.Attr{xml.Name{"", "version"}, "1.0"}},
}

var stringStartElement = xmlElement("string")
var realStartElement = xmlElement("real")
var boolTrueElement = xmlElement("true")   // var boolTrueElementName = "true"
var boolFalseElement = xmlElement("false") // var boolFalseElementName = "false"
var integerStartElement = xmlElement("integer")
var dateStartElement = xmlElement("date")
var dataStartElement = xmlElement("data")

const dateFormat = time.RFC3339