diff --git a/contentscript.js b/contentscript.js index 63e4fb0..f587824 100644 --- a/contentscript.js +++ b/contentscript.js @@ -48,7 +48,7 @@ function checkRdfXmlLicense(data, format) { var parser = new DOMParser(); - doc = parser.parseFromString(data, 'text/xml'); + var doc = parser.parseFromString(data, 'text/xml'); try { var rdf = $.rdf().load(doc); var licenses = rdf @@ -92,6 +92,7 @@ } if (format != null) { peelBackRdf(data, format); + console.log("baseURI: " + data.baseURI); chrome.runtime.sendMessage({ method: 'setLicense', type: format, diff --git a/jquery.rdfquery.core-1.0.js b/jquery.rdfquery.core-1.0.js index 65fff47..ba35eb1 100644 --- a/jquery.rdfquery.core-1.0.js +++ b/jquery.rdfquery.core-1.0.js @@ -580,10 +580,10 @@ this.value = d.value(d.strip ? strip(value) : value); return this; } else { - throw { - name: 'InvalidValue', - message: value + ' is not a valid ' + datatype + ' value' - }; + this.representation = value; + this.datatype = datatype; + this.value = value; + return this; } } }; @@ -810,7 +810,7 @@ $.typedValue.valid = function (value, datatype) { var d = $.typedValue.types[datatype]; if (d === undefined) { - throw "InvalidDatatype: The datatype " + datatype + " can't be recognised"; + return false; } else { value = d.strip ? strip(value) : value; if (d.regex.test(value)) {