JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 380
  • Score
    100M100P100Q96345F
  • License MIT

Package Exports

  • xslt

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xslt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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:

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);