This library is a light wrapper around the xsltproc tool which allows for XSLT transformations of XML documents.
The library uses xsltproc 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 binary for the best performance.
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml")
Using params:
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml", "--stringparam var_name value")
{:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "<xml>...</xml>", "--xml-as-string")
If available in Hex, the package can be installed
by adding xslt
to your list of dependencies in mix.exs
:
def deps do
[{:xslt, "~> 0.1.0"}]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/xslt.