-
Notifications
You must be signed in to change notification settings - Fork 23
/
xslt.go
31 lines (23 loc) · 809 Bytes
/
xslt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package godom
// This file implements JavaScript/XSLT Bindings
// https://developer.mozilla.org/en-US/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/JavaScript_XSLT_Bindings
import (
"github.com/gopherjs/gopherjs/js"
)
type XSLTProcessor struct {
*js.Object
}
func NewXSLTProcessor() *XSLTProcessor {
return &XSLTProcessor{Window.Get("XSLTProcessor").New()}
}
// Methods
// https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor#Methods
func (x *XSLTProcessor) ImportStylesheet(node *Object) {
x.Call("importStylesheet", node)
}
func (x *XSLTProcessor) TransformToFragment(node, document *Object) *Object {
return &Object{x.Call("transformToFragment", node, document)}
}
func (x *XSLTProcessor) TransformToDocument(node *Object) *Object {
return &Object{x.Call("transformToDocument", node)}
}