diff --git a/Frontend/assets/samples/XSLTTemplate.xslt b/Frontend/assets/samples/XSLTTemplate.xslt new file mode 100644 index 0000000..3ce05e2 --- /dev/null +++ b/Frontend/assets/samples/XSLTTemplate.xslt @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index ab7f46c..968749a 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -84,6 +84,24 @@ function fillDefaultXML(element) { } } + +/** + * The `fillDefaultXSLT()` function fetches a default XSLT template from the server and sets the value of the element with id "transformArea" to the fetched template. + * + * @function + * @name fillDefaultXSLT + * @kind function + * @returns {void} + */ +function fillDefaultXSLT() { + const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt") + .then( response => response.text() ) + .then( (XSTLTemplate) => { + document.getElementById('transformArea').value = XSTLTemplate; + } ) +} + /** * It sets default content for the element an changes it's color to grey * diff --git a/Frontend/tools/xslt.html b/Frontend/tools/xslt.html index 674a7cc..50d3d94 100644 --- a/Frontend/tools/xslt.html +++ b/Frontend/tools/xslt.html @@ -25,7 +25,7 @@