# xslt

> ![Bower version](https://img.shields.io/bower/v/xslt.svg) [![npm version](https://img.shields.io/npm/v/xslt.svg)](https://www.npmjs.com/package/xslt) [![Build Status](https://travis-ci.org/murrayju/xslt.svg?branch=master)](https://travis-ci.org/murrayju/x

Latest version **0.9.1** (published 2017-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install xslt
pnpm add xslt
yarn add xslt
bun add xslt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2017-08-09 |
| First published | 2015-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.33 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | murrayju |
| Keywords | js, xslt, xml |

## Links

- npm: https://www.npmjs.com/package/xslt
- Repository: https://github.com/murrayju/xslt
- Issues: https://github.com/murrayju/xslt/issues
- npm.io page: https://npm.io/package/xslt

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.9.1 (latest) — 2017-08-09
- 0.9.0 — 2017-08-09
- 0.8.1 — 2017-06-22
- 0.8.0 — 2017-04-14
- 0.7.0 — 2015-11-20
- 0.6.0 — 2015-11-19
- 0.5.0 — 2015-08-06
- 0.4.0 — 2015-07-21
- 0.3.0 — 2015-06-25
- 0.2.1 — 2015-06-24
- 0.1.0 — 2015-06-23

## README

# xslt
![Bower version](https://img.shields.io/bower/v/xslt.svg)
[![npm version](https://img.shields.io/npm/v/xslt.svg)](https://www.npmjs.com/package/xslt)
[![Build Status](https://travis-ci.org/murrayju/xslt.svg?branch=master)](https://travis-ci.org/murrayju/xslt)
[![Coverage Status](https://coveralls.io/repos/murrayju/xslt/badge.svg)](https://coveralls.io/r/murrayju/xslt)
[![devDependency Status](https://david-dm.org/murrayju/xslt/dev-status.svg)](https://david-dm.org/murrayju/xslt#info=devDependencies)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/murrayju_xslt.svg)](https://saucelabs.com/u/murrayju_xslt)

A simple wrapper around browser based xslt. Includes some cleanup options to help normalize the output across browsers.

## Quick start

Several options are available to get started:

- [Download the latest release](https://github.com/murrayju/xslt/releases).
- Clone the repo: `git clone https://github.com/murrayju/xslt.git`.
- Install with [Bower](http://bower.io): `bower install xslt`.
- Install with [npm](https://www.npmjs.com): `npm install xslt`.

## Example

```js
// Here are the options with their default values
options = {
  fullDocument: false, // Is the output a complete document, or a fragment?
  cleanup: true, // false will disable all of the below options
  xmlHeaderInOutput: true,
  normalizeHeader: true,
  encoding: 'UTF-8',
  preserveEncoding: false, // When false, always uses the above encoding. When true, keeps whatever the doc says
  removeDupNamespace: true,
  removeDupAttrs: true,
  removeNullNamespace: true,
  removeAllNamespaces: false,
  removeNamespacedNamespace: true,
  moveNamespacesToRoot: false,

  // These two are mutually exclusive. Attempting to use both is the same as using neither
  collapseEmptyElements: true, // Forces output of self-closing tags
  expandCollapsedElements: false, // Forces output of separate closing tags
};
outputXmlString = xslt(inputXmlString, xslString, options);
```

It is also possible to just run the cleanup function itself. This uses the same `options` as above.
```js
outputXmlString = xslt.cleanup(intermediateXmlString, options);
```

---
_Source: https://npm.io/package/xslt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
