Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnhamelink/xslt
A lightweight wrapper around xsltproc for elixir
https://github.com/johnhamelink/xslt
elixir porcelain xml xslt xsltproc
Last synced: 3 months ago
JSON representation
A lightweight wrapper around xsltproc for elixir
- Host: GitHub
- URL: https://github.com/johnhamelink/xslt
- Owner: johnhamelink
- License: mit
- Created: 2017-03-08T10:57:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-22T13:38:08.000Z (over 3 years ago)
- Last Synced: 2024-10-01T15:43:53.577Z (4 months ago)
- Topics: elixir, porcelain, xml, xslt, xsltproc
- Language: Elixir
- Size: 24.4 KB
- Stars: 12
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Xslt
This library is a light wrapper around the
[xsltproc](http://xmlsoft.org/XSLT/xsltproc2.html) tool which allows for XSLT
transformations of XML documents.## Prerequesites
The library uses [xsltproc](http://xmlsoft.org/XSLT/xsltproc2.html) to process
the documents. It comes preinstalled on OSX, and can be installed simply on
debian-based linux distros with `apt-get install xsltproc`.The library uses porcelain to communicate safely with xsltproc, so you should
install the [goon](https://github.com/alco/goon/releases) binary for the best
performance.## Usage
```elixir
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml")
```Using params:
```elixir
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml", "--stringparam var_name value")
```
```elixir
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "...", "--xml-as-string")
```
## InstallationIf [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `xslt` to your list of dependencies in `mix.exs`:```elixir
def deps do
[{:xslt, "~> 0.1.0"}]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/xslt](https://hexdocs.pm/xslt).