https://github.com/wamuir/go-xslt
XSLT 1.0 Transformations in Go via Libxslt
https://github.com/wamuir/go-xslt
go golang libxslt xslt
Last synced: 2 months ago
JSON representation
XSLT 1.0 Transformations in Go via Libxslt
- Host: GitHub
- URL: https://github.com/wamuir/go-xslt
- Owner: wamuir
- License: mit
- Created: 2020-06-11T19:52:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-16T13:59:53.000Z (over 1 year ago)
- Last Synced: 2025-05-06T22:44:36.848Z (2 months ago)
- Topics: go, golang, libxslt, xslt
- Language: Go
- Homepage: https://pkg.go.dev/github.com/wamuir/go-xslt
- Size: 32.2 KB
- Stars: 16
- Watchers: 2
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-xslt
=====[](https://pkg.go.dev/github.com/wamuir/go-xslt)
[](https://github.com/wamuir/go-xslt/actions/workflows/go.yml?query=event%3Apush+branch%3Amaster)
[](https://codecov.io/gh/wamuir/go-xslt)
[](https://goreportcard.com/report/github.com/wamuir/go-xslt)# Description
`go-xslt` is a Go module that performs basic XSLT 1.0 transformations via Libxslt.
# Installation
You'll need the development libraries for libxml2 and libxslt, along with those for liblzma and zlib. Install these via your package manager. For instance, if using `apt` then:
sudo apt install libxml2-dev libxslt1-dev liblzma-dev zlib1g-dev
This module can be installed with the `go get` command:
go get -u github.com/wamuir/go-xslt
# Usage
```go
// style is an XSLT 1.0 stylesheet, as []byte.
xs, err := xslt.NewStylesheet(style)
if err != nil {
panic(err)
}
defer xs.Close()// doc is an XML document to be transformed and res is the result of
// the XSL transformation, both as []byte.
res, err := xs.Transform(doc)
if err != nil {
panic(err)
}```