Added support for changing engines
This commit is contained in:
		| @@ -3,18 +3,25 @@ import { onMounted, ref, watch } from 'vue'; | ||||
|  | ||||
| const xml = ref(''); | ||||
| const transform = ref(''); | ||||
| const transformPlaceholder = ref('') | ||||
| const result = ref('') | ||||
| const transformPlaceholder = ref(''); | ||||
| const engine = ref(''); | ||||
| const result = ref(''); | ||||
|  | ||||
| const activeXmlTool = ref('') | ||||
| const activeXmlTool = ref(''); | ||||
|  | ||||
| async function submit() { | ||||
|   const url = document.location.protocol + "//" + document.location.hostname + "/java/" + activeXmlTool.value; | ||||
|   const engineEndpoint = engine.value == "libxml" ? "libxml" : "java" | ||||
|   const url = document.location.protocol + "//" + document.location.hostname + "/" + engineEndpoint + "/" + activeXmlTool.value; | ||||
|  | ||||
|   var version = "1.0"; | ||||
|   if (engine.value == "saxon") | ||||
|     version = "3.0" | ||||
|  | ||||
|   var requestBody = JSON.stringify({ | ||||
|     "data": xml.value, | ||||
|     "process": transform.value, | ||||
|     "processor": "xalan", | ||||
|     "version": "3.0" | ||||
|     "processor": engine.value, | ||||
|     "version": version | ||||
|   }); | ||||
|  | ||||
|   var request = new Request(url, { | ||||
| @@ -61,6 +68,12 @@ onMounted(() => { | ||||
|   <label for="xquery">XQuery</label> | ||||
|   <input v-model="activeXmlTool" type="radio" id="xquery" name="xmltool" value="xquery" /> | ||||
|   <br /><br /> | ||||
|   <select name="engine" v-model="engine"> | ||||
|     <option value="saxon" selected>Saxon</option> | ||||
|     <option value="xalan">Xalan</option> | ||||
|     <option value="libxml">libXML</option> | ||||
|   </select> | ||||
|   <br /> | ||||
|   <textarea v-model="xml" id="xml" placeholder="XML"></textarea> | ||||
|   <textarea v-model="transform" id="transform" :placeholder="transformPlaceholder"></textarea><br /> | ||||
|   <button @click="submit">Submit</button><br /> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user