Package Exports
- is-xml
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 (is-xml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-xml
Check if a String/Buffer is XML(HTML/XHTML/SVG/MathML/XUL/XBL/RSS)
Install
npm install --save is-xmlUsage
var isXML = require('is-xml');XML
isXML('<message><warning>I am XML</warning></message>');
isXML(
'<标题>一丝是谁?</标题>' +
'<简介>当你们每天喊我「丝姐」的时候' +
'我深深的沉浸在其中不能自拔</简介>'
);
// => trueHTML
isXML('<html>');
isXML('<html></html>');
isXML('<input type="text" />');
isXML('<img src="#" alt="img"/>');
// => trueSVG
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>');
// => trueEmjio 😂
isXML('<p class="foo_bar-🙈🔞🙈" id="👻">');
isXML('<p 😂👻😂="foo_bar">');
isXML('<foo😘( ●─● )💓></foo😘( ●─● )💓>');
isXML('<p class="(ོ•̀⌄•́)ོ"></p>');
// => true