lib/validator.js
function (namespaces, defaultNamespace, name) {
    var self = this;

    assert(namespaces);
    assert(name);
    if (/^\{.+\}/.test(name)) {
      return name;
    }
    else if (/:/.test(name)) {
      var parts = name.split(':');
      assert(parts.length === 2, parts);
      if (!namespaces[parts[0]]) {
        throw new xml2js.ValidationError("Unknown namespace " + parts[0] + ", name: " + name + ", known namespaces: " + util.inspect(namespaces, false, null));
      }
      return '{' + namespaces[parts[0]] + '}' + parts[1];
    }
    else if (defaultNamespace) {
      return '{' + defaultNamespace + '}' + name;
    }
    else {
      throw new xml2js.ValidationError("Unqualified name and no default namespace: " + name);
    }
  }
function (namespaces, defaultNamespace, name) {
    var self = this;

    assert(namespaces);
    assert(name);
    if (/^\{.+\}/.test(name)) {
      return name;
    }
    else if (/:/.test(name)) {
      var parts = name.split(':');
      assert(parts.length === 2, parts);
      if (!namespaces[parts[0]]) {
        throw new xml2js.ValidationError("Unknown namespace " + parts[0] + ", name: " + name + ", known namespaces: " + util.inspect(namespaces, false, null));
      }
      return '{' + namespaces[parts[0]] + '}' + parts[1];
    }
    else if (defaultNamespace) {
      return '{' + defaultNamespace + '}' + name;
    }
    else {
      throw new xml2js.ValidationError("Unqualified name and no default namespace: " + name);
    }
  }
function ( namespaces , defaultNamespace , name ) { var self = this ; assert ( namespaces ) ; assert ( name ) ; if ( / ^\{.+\} / . test ( name ) ) { return name ; } else if ( / : / . test ( name ) ) { var parts = name . split ( ':' ) ; assert ( parts . length === 2 , parts ) ; if ( ! namespaces [ parts [ 0 ] ] ) { throw new xml2js . ValidationError ( "Unknown namespace " + parts [ 0 ] + ", name: " + name + ", known namespaces: " + util . inspect ( namespaces , false , null ) ) ; } return '{' + namespaces [ parts [ 0 ] ] + '}' + parts [ 1 ] ; } else if ( defaultNamespace ) { return '{' + defaultNamespace + '}' + name ; } else { throw new xml2js . ValidationError ( "Unqualified name and no default namespace: " + name ) ; } }
Similar to XsdSchema.namespacedName, just using arguments
Similar to XsdSchema . namespacedName just using arguments