项目作者: johnhamelink

项目描述 :
A lightweight wrapper around xsltproc for elixir
高级语言: Elixir
项目地址: git://github.com/johnhamelink/xslt.git
创建时间: 2017-03-08T10:57:45Z
项目社区:https://github.com/johnhamelink/xslt

开源协议:MIT License

下载


Xslt

This library is a light wrapper around the
xsltproc tool which allows for XSLT
transformations of XML documents.

Prerequesites

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.

Usage

  1. {:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml")

Using params:

  1. {:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "/path/to/xml_file.xml", "--stringparam var_name value")
  1. {:ok, transformed_xml} = Xslt.transform("/path/to/template.xml", "<xml>...</xml>", "--xml-as-string")

Installation

If available in Hex, the package can be installed
by adding xslt to your list of dependencies in mix.exs:

  1. def deps do
  2. [{:xslt, "~> 0.1.0"}]
  3. end

Documentation can be generated with ExDoc
and published on HexDocs. Once published, the docs can
be found at https://hexdocs.pm/xslt.