1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-02 12:00:03 +02:00
Files
minifyfromhtml/node_modules/w3c-xmlserializer
s2 a4b62da0ba use terser and clean-css directly
create a sourcemap as well by default
2020-02-13 15:39:37 +01:00
..
2019-03-29 15:56:41 +01:00
2020-02-13 15:39:37 +01:00
2019-03-29 15:56:41 +01:00

w3c-xmlserializer

An XML serializer that follows the W3C specification.

This module is mostly used as an internal part of jsdom. However, you can use it independently with some care. That isn't very well-documented yet, but hopefully the below sample can give you an idea.

Basic usage

const { XMLSerializer } = require("w3c-xmlserializer");
const { JSDOM } = require("jsdom");

const { document } = new JSDOM().window;
const XMLSerializer = XMLSerializer.interface;
const serializer = new XMLSerializer();
const doc = document.createElement("akomaNtoso");

console.log(serializer.serializeToString(doc));
// => '<akomantoso xmlns="http://www.w3.org/1999/xhtml"></akomantoso>'