XuelesszzZ 94af2b8e7b 6-30-5 | hai 1 ano | |
---|---|---|
.. | ||
lib | hai 1 ano | |
README.md | hai 1 ano | |
package.json | hai 1 ano |
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.
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>'