2015-05-07 10:44:52 +00:00
|
|
|
package render
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2015-05-18 13:45:24 +00:00
|
|
|
type XML struct {
|
|
|
|
Data interface{}
|
2015-05-07 10:44:52 +00:00
|
|
|
}
|
|
|
|
|
2015-05-18 13:45:24 +00:00
|
|
|
func (r XML) Write(w http.ResponseWriter) error {
|
|
|
|
w.Header().Set("Content-Type", "application/xml; charset=utf-8")
|
|
|
|
return xml.NewEncoder(w).Encode(r.Data)
|
2015-05-07 10:44:52 +00:00
|
|
|
}
|