Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detailed-xml-validator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detailed-xml-validator

Validate for XML schema and returns all the possible failures

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

detailed-xml-validator

Validate for XML schema and returns all the possible failures

Sample Rules file

<?xml version = "1.0"?>

<students nillable="false">
    <student minOccurs="1">
        <firstname minLength="3" maxLength="10" nillable="false"></firstname>
        <lastname minLength="3" maxLength="10" nillable="false"></lastname>
        <nickname minLength="3" maxLength="10"></nickname>
        <email pattern="[a-z0-9]+@schoolname.org" nillable="false"></email>
        <age type="positiveInteger" min="9" max="19"></age>
        <contact>
            <phone length="10"></phone>
        </contact>
        <gender nillable="false" ></gender>
        <marks minOccurs="1" maxOccurs="1">
            <subject minOccurs="5" maxOccurs="6" >
                <name pattern="math|hindi|english|science|history"></name>
                <score type="positiveDecimal"></score>
            </subject>
        </marks>
    </student>
</students>

Sample code

const Validator = require("detailed-xml-validator");

const options = {
    unknownAllow: true,
    boolean: ["true", "false"],
};

const validator = new Validator(rules, options);
const failures = validator.validate(xmlStringData);
console.log(`Found ${failures.length} issues`);

Keywords

FAQs

Package last updated on 27 Sep 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc