var data = ''; var originalDoc = new DOMParser().parseFromString(data, "text/xml");
var processor = new XSLTProcessor();
processor.importStylesheet(styleDoc);
var fragment = processor.transformToFragment(originalDoc, document); var content = document.getElementById("content");
content.appendChild(fragment);
// use Gecko's Date.parse to parse, then compare the milliseconds since epoch var xslt_ms = Date.parse(content.innerHTML); var now_ms = new Date().getTime(); var accepted_diff = 30 * 60 * 1000; // 30 minutes var diff = Math.abs(now_ms - xslt_ms);
ok(diff < accepted_diff, "generated timestamp should be not more than "
+ accepted_diff + " ms before 'now', but the difference was: " + diff);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.