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