src/indexOld.js
function isSCXMLValid(model){
        return new Promise(function(resolve, reject) {
            if(model === "") {
                reject("Model is empty");
                return;
            }

            validator.validateXML(model, __dirname + '/xmlSchemas/scxml.xsd', function(err, result) {
                if (err) {
                    reject(err);
                    return;
                }
                resolve(result.valid);
            })
        });
    }
function isSCXMLValid(model){
        return new Promise(function(resolve, reject) {
            if(model === "") {
                reject("Model is empty");
                return;
            }

            validator.validateXML(model, __dirname + '/xmlSchemas/scxml.xsd', function(err, result) {
                if (err) {
                    reject(err);
                    return;
                }
                resolve(result.valid);
            })
        });
    }
function isSCXMLValid ( model ) { return new Promise ( function ( resolve , reject ) { if ( model === "" ) { reject ( "Model is empty" ) ; return ; } validator . validateXML ( model , __dirname + '/xmlSchemas/scxml.xsd' , function ( err , result ) { if ( err ) { reject ( err ) ; return ; } resolve ( result . valid ) ; } ) } ) ; }
Validates SCXML markup as a string
@method isSCXMLValid
@param {String} model A string with the SCXML document to validate
@returns {Promise} True if the SCXML is valid false otherwise
Validates SCXML markup as a string