diff js/core.js @ 2687:66a24a6a0358

#180. specification now holds processAttribute as private function. Schema is also set-once and hold
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Sat, 11 Mar 2017 08:48:04 +0000
parents 0a72855de078
children f4a146282ef5
line wrap: on
line diff
--- a/js/core.js	Sat Mar 11 08:14:08 2017 +0000
+++ b/js/core.js	Sat Mar 11 08:48:04 2017 +0000
@@ -193,9 +193,7 @@
     var xmlhttp = new XMLHttpRequest();
     xmlhttp.open("GET", 'xml/test-schema.xsd', true);
     xmlhttp.onload = function () {
-        schemaXSD = xmlhttp.response;
-        var parse = new DOMParser();
-        specification.schema = parse.parseFromString(xmlhttp.response, 'text/xml');
+        specification.processSchema(xmlhttp.response);
         var r = new XMLHttpRequest();
         r.open('GET', url, true);
         r.onload = function () {
@@ -252,7 +250,7 @@
         // Perform XML schema validation
         var Module = {
             xml: response,
-            schema: schemaXSD,
+            schema: specification.getSchemaString(),
             arguments: ["--noout", "--schema", 'test-schema.xsd', 'document.xml']
         };
         projectXML = responseDocument;