You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

xslt

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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
Source
npmnpm
Version
0.9.1
Version published
Maintainers
1
Created
Source

xslt

Bower version npm version Build Status Coverage Status devDependency Status

Sauce Test Status

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.
  • Clone the repo: git clone https://github.com/murrayju/xslt.git.
  • Install with Bower: bower install xslt.
  • Install with npm: npm install xslt.

Example

// 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.

outputXmlString = xslt.cleanup(intermediateXmlString, options);

Keywords

js

FAQs

Package last updated on 09 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts