Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
is-xml
Advanced tools
Readme
Check if a String/Buffer is XML(HTML/XHTML/SVG/MathML/XUL/XBL/RSS)
npm install --save is-xml
var isXML = require('is-xml');
isXML('<message><warning>I am XML</warning></message>');
isXML(
'<标题>一丝是谁?</标题>' +
'<简介>当你们每天喊我「丝姐」的时候' +
'我深深的沉浸在其中不能自拔</简介>'
);
// => true
isXML('<html>');
isXML('<html></html>');
isXML('<input type="text" />');
isXML('<img src="#" alt="img"/>');
// => true
isXML('<svg width="100" height="100" viewBox="0 0 30 30" version="1.1"></svg>');
isXML('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg></svg>');
// => true
isXML('<p class="foo_bar-🙈🔞🙈" id="👻">');
isXML('<p 😂👻😂="foo_bar">');
isXML('<foo😘( ●─● )💓></foo😘( ●─● )💓>');
isXML('<p class="(ོ•̀⌄•́)ོ"></p>');
// => true
FAQs
Check if a string is XML
The npm package is-xml receives a total of 194 weekly downloads. As such, is-xml popularity was classified as not popular.
We found that is-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
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.