
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
sanitize-xml
Advanced tools
‘sanitize-xml’ simply sanitizes xml. Works in both Node.js and the browser. No dependencies.
‘sanitize-xml’ simply sanitizes xml. Works in both Node.js and the browser. No dependencies.
npm install sanitize-xml
<script type="text/javascript" src="https://cdn.rawgit.com/jackens/sanitize-xml/master/sanitize-xml.js"></script>
const sanitizeXml = require('sanitize-xml')
sanitizeXml(someXmlString, options)
Defaults:
{
allowedTags: { a: { href: true }, b: {}, blockquote: {}, br: {}, del: {}, div: {}, em: {}, figcaption: {}, figure: {}, font: {}, h1: {}, h2: {}, h3: {}, h4: {}, h5: {}, h6: {}, hr: {}, i: {}, img: { src: true, alt: true }, li: {}, ol: {}, p: {}, s: {}, span: {}, strong: {}, sub: {}, sup: {}, table: {}, tbody: {}, td: {}, tfoot: {}, th: {}, thead: {}, tr: {}, u: {}, ul: {} },
caseInsensitiveTags: true,
caseInsensitiveAttributes: true,
removeComments: true
}
More usage examples: https://github.com/jackens/sanitize-xml/blob/master/test.js.
FAQs
‘sanitize-xml’ simply sanitizes xml. Works in both Node.js and the browser. Lightweight. No dependencies.
We found that sanitize-xml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.