Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Validates whether a string matches the production for an XML name or qualified name

License

NotificationsYou must be signed in to change notification settings

jsdom/xml-name-validator

Repository files navigation

This package simply tells you whether or not a string matches theName orQName productions in the XML Namespaces specification. We use it for implementing thevalidate algorithm in jsdom, but you can use it for whatever you want.

Usage

This package's main module exports two functions,name() andqname(). Both take a string and return a boolean indicating whether or not the string matches the relevant production.

"use strict":constxnv=require("xml-name-validator");// Will return truexnv.name("x");xnv.name(":");xnv.name("a:0");xnv.name("a:b:c");// Will return falsexnv.name("\\");xnv.name("'");xnv.name("0");xnv.name("a!");// Will return truexnv.qname("x");xnv.qname("a0");xnv.qname("a:b");// Will return falsexnv.qname(":a");xnv.qname(":b");xnv.qname("a:b:c");xnv.qname("a:0");

About

Validates whether a string matches the production for an XML name or qualified name

Resources

License

Security policy

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp