From 83f66c64a1e138fce28138d82412c11a9e916861 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 14 Jun 2023 08:45:43 +0200 Subject: [PATCH] Added support for changing engines --- new-frontend/src/components/XmlTool.vue | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/new-frontend/src/components/XmlTool.vue b/new-frontend/src/components/XmlTool.vue index 37cc37a..c227da5 100644 --- a/new-frontend/src/components/XmlTool.vue +++ b/new-frontend/src/components/XmlTool.vue @@ -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(() => {

+ +