widlam/refactoring/issue#120 #128
@@ -87,7 +87,7 @@ div#copyright a, a:visited, a:active {
|
|||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolListRow a {
|
.toolListRow a {
|
||||||
display: block;
|
display: block;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -95,7 +95,7 @@ div#copyright a, a:visited, a:active {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolListRow a:hover {
|
.toolListRow a:hover {
|
||||||
background-color: #2A93B0;
|
background-color: #2A93B0;
|
||||||
color: white;
|
color: white;
|
||||||
transform: scale(1.25, 1.25);
|
transform: scale(1.25, 1.25);
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ const color_grey = "#6b6b6b";
|
|||||||
const color_red = "#ff8f8f";
|
const color_red = "#ff8f8f";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It clears default content of the element and sets it's color to black.
|
* It clears default content of the element and sets it's color to black.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name clearDefaultContent
|
* @name clearDefaultContent
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} element to set
|
* @param {any} element to set
|
||||||
* @param {any} text to set
|
* @param {any} text to set
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function clearDefaultContent(element, text) {
|
function clearDefaultContent(element, text) {
|
||||||
if (element.value == text) {
|
if (element.value == text) {
|
||||||
element.value = "";
|
element.value = "";
|
||||||
@@ -21,13 +21,38 @@ function clearDefaultContent(element, text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It clears all data fields.
|
* It returns the value of the element with id "processors".
|
||||||
|
*
|
||||||
|
* @function
|
||||||
|
* @name getProcessor
|
||||||
|
* @kind function
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
function getProcessor() {
|
||||||
|
return document.getElementById("processors").value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It returns the value of the element with id "versions".
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name clearDataField
|
* @name getVersion
|
||||||
* @kind function
|
* @kind function
|
||||||
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
function clearDataField(){
|
function getVersion() {
|
||||||
|
return document.getElementById("versions").value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It clears all data fields.
|
||||||
|
*
|
||||||
|
* @function
|
||||||
|
* @name clearDataField
|
||||||
|
* @kind function
|
||||||
|
*/
|
||||||
|
function clearDataField() {
|
||||||
document.getElementById("xmlArea").value = "";
|
document.getElementById("xmlArea").value = "";
|
||||||
document.getElementById("xmlArea").style.color = null;
|
document.getElementById("xmlArea").style.color = null;
|
||||||
document.getElementById("xmlArea").style.backgroundColor = null;
|
document.getElementById("xmlArea").style.backgroundColor = null;
|
||||||
@@ -37,28 +62,37 @@ function clearDataField(){
|
|||||||
document.getElementById("transformArea").style.backgroundColor = null;
|
document.getElementById("transformArea").style.backgroundColor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It fills the XML area with a sample XML.
|
||||||
|
*
|
||||||
|
* @function
|
||||||
|
* @name fillDefaultXML
|
||||||
|
* @kind function
|
||||||
|
* @param {any} element
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
function fillDefaultXML(element) {
|
function fillDefaultXML(element) {
|
||||||
if(element.classList.contains("active")){
|
if (element.classList.contains("active")) {
|
||||||
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
|
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
|
||||||
clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
|
clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
|
||||||
fetch(serverAddress + "/assets/samples/sampleXml.xml")
|
fetch(serverAddress + "/assets/samples/sampleXml.xml")
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then((exampleData) => {
|
.then((exampleData) => {
|
||||||
document.getElementById("xmlArea").value = exampleData;
|
document.getElementById("xmlArea").value = exampleData;
|
||||||
document.getElementById("xmlArea").style.backgroundColor = null;
|
document.getElementById("xmlArea").style.backgroundColor = null;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It sets default content for the element an changes it's color to grey
|
* It sets default content for the element an changes it's color to grey
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name setDefaultContent
|
* @name setDefaultContent
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} element to set
|
* @param {any} element to set
|
||||||
* @param {any} text to set
|
* @param {any} text to set
|
||||||
*/
|
*/
|
||||||
function setDefaultContent(element, text) {
|
function setDefaultContent(element, text) {
|
||||||
if (element.value == "") {
|
if (element.value == "") {
|
||||||
var id = element.getAttribute('id');
|
var id = element.getAttribute('id');
|
||||||
@@ -81,14 +115,14 @@ function setDefaultContent(element, text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It hides list for specified version of XPath
|
* It hides list for specified version of XPath
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name hideList
|
* @name hideList
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} collList class name of list to hide
|
* @param {any} collList class name of list to hide
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function hideList(collList) {
|
function hideList(collList) {
|
||||||
for (i = 0; i < collList.length; i++) {
|
for (i = 0; i < collList.length; i++) {
|
||||||
if (collList[i].nextElementSibling !== null) {
|
if (collList[i].nextElementSibling !== null) {
|
||||||
@@ -101,27 +135,27 @@ function hideList(collList) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It checks if the text is a default text.
|
* It checks if the text is a default text.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name checkDefault
|
* @name checkDefault
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} text
|
* @param {any} text
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function checkDefault(text){
|
function checkDefault(text) {
|
||||||
return defaultStrings.includes(text);
|
return defaultStrings.includes(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It show list for specified version of XPath
|
* It show list for specified version of XPath
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name showList
|
* @name showList
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} collList class name of list to hide
|
* @param {any} collList class name of list to hide
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function showList(collList) {
|
function showList(collList) {
|
||||||
for (i = 0; i < collList.length; i++) {
|
for (i = 0; i < collList.length; i++) {
|
||||||
collList[i].style.display = 'block';
|
collList[i].style.display = 'block';
|
||||||
@@ -129,20 +163,19 @@ function showList(collList) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that is used to fold/unfold collapsible elements.
|
* A function that is used to fold/unfold collapsible elements.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name smoothFoldElement
|
* @name smoothFoldElement
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} element
|
* @param {any} element
|
||||||
* @param {any} toogleState
|
* @param {any} toogleState
|
||||||
* @param {any} toggleParrent
|
* @param {any} toggleParrent
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function smoothFoldElement(element, toogleState, toggleParrent){
|
function smoothFoldElement(element, toogleState, toggleParrent) {
|
||||||
if (toogleState) {
|
if (toogleState) {
|
||||||
console.log("DUPA");
|
if (toggleParrent) {
|
||||||
if(toggleParrent){
|
|
||||||
element.parentElement.style.maxHeight = "0px";
|
element.parentElement.style.maxHeight = "0px";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,13 +194,13 @@ function smoothFoldElement(element, toogleState, toggleParrent){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set tooltip info, function is called by onClick handlers
|
* Set tooltip info, function is called by onClick handlers
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name refreshTooltip
|
* @name refreshTooltip
|
||||||
* @kind function
|
* @kind function
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function refreshTooltip() {
|
function refreshTooltip() {
|
||||||
var resizeList = document.getElementsByClassName("collapsibleData");
|
var resizeList = document.getElementsByClassName("collapsibleData");
|
||||||
console.log("collDataList: " + resizeList.length)
|
console.log("collDataList: " + resizeList.length)
|
||||||
@@ -178,17 +211,17 @@ function refreshTooltip() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that performs a request to the server.
|
* A function that performs a request to the server.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name performRequest
|
* @name performRequest
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} endpoint of target service
|
* @param {any} endpoint of target service
|
||||||
* @param {any} checkXML enable checking for empty XML
|
* @param {any} checkXML enable checking for empty XML
|
||||||
* @param {any} checkTransform enable checking for empty transform data
|
* @param {any} checkTransform enable checking for empty transform data
|
||||||
* @returns {false | undefined}
|
* @returns {false | undefined}
|
||||||
*/
|
*/
|
||||||
function performRequest(endpoint, checkXML, checkTransform){
|
function performRequest(endpoint, checkXML, checkTransform) {
|
||||||
const sourceId = "xmlArea";
|
const sourceId = "xmlArea";
|
||||||
const transformId = "transformArea";
|
const transformId = "transformArea";
|
||||||
var xmlData = document.getElementById(sourceId).value.trim();
|
var xmlData = document.getElementById(sourceId).value.trim();
|
||||||
@@ -201,16 +234,16 @@ function performRequest(endpoint, checkXML, checkTransform){
|
|||||||
|
|
||||||
var empty = false;
|
var empty = false;
|
||||||
if (defaultStrings.includes(xmlData) && checkXML) {
|
if (defaultStrings.includes(xmlData) && checkXML) {
|
||||||
document.getElementById(sourceId).style.backgroundColor = color_red;
|
document.getElementById(sourceId).style.backgroundColor = color_red;
|
||||||
xmlData = "";
|
xmlData = "";
|
||||||
empty = true;
|
empty = true;
|
||||||
}
|
}
|
||||||
if (defaultStrings.includes(transformData) && checkTransform) {
|
if (defaultStrings.includes(transformData) && checkTransform) {
|
||||||
document.getElementById(transformId).style.backgroundColor = color_red;
|
document.getElementById(transformId).style.backgroundColor = color_red;
|
||||||
empty = true;
|
empty = true;
|
||||||
}
|
}
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
restRequest(port, endpoint, xmlData, transformData).then(function(result) {
|
restRequest(port, endpoint, xmlData, transformData).then(function (result) {
|
||||||
document.getElementById("resultArea").value = result.result;
|
document.getElementById("resultArea").value = result.result;
|
||||||
document.getElementById("procinfo").innerText = ' Computed using '.concat(" ", result.processor);
|
document.getElementById("procinfo").innerText = ' Computed using '.concat(" ", result.processor);
|
||||||
if (result.status = "OK") {
|
if (result.status = "OK") {
|
||||||
@@ -220,7 +253,7 @@ function performRequest(endpoint, checkXML, checkTransform){
|
|||||||
procinfo.style.color = "#aa3030";
|
procinfo.style.color = "#aa3030";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
document.getElementById("resultArea").value = "No data provided!";
|
document.getElementById("resultArea").value = "No data provided!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -228,18 +261,18 @@ function performRequest(endpoint, checkXML, checkTransform){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that prepares data to send and handles response
|
* Function that prepares data to send and handles response
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name performFormatRequest
|
* @name performFormatRequest
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} endpoint of target service
|
* @param {any} endpoint of target service
|
||||||
* @param {any} checkXML enable checking for empty XML
|
* @param {any} checkXML enable checking for empty XML
|
||||||
* @param {any} sourceId ID of element to get XML from
|
* @param {any} sourceId ID of element to get XML from
|
||||||
* @param {any} targetId ID of element to write formatted XML
|
* @param {any} targetId ID of element to write formatted XML
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function performFormatRequest(endpoint, checkXML, sourceId, targetId){
|
function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
|
||||||
const sourceElement = document.getElementById(sourceId);
|
const sourceElement = document.getElementById(sourceId);
|
||||||
const targetElement = document.getElementById(targetId);
|
const targetElement = document.getElementById(targetId);
|
||||||
const infoElement = document.getElementById("formatinfo");
|
const infoElement = document.getElementById("formatinfo");
|
||||||
@@ -248,13 +281,13 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){
|
|||||||
|
|
||||||
var empty = false;
|
var empty = false;
|
||||||
if (defaultStrings.includes(xmlData) && checkXML) {
|
if (defaultStrings.includes(xmlData) && checkXML) {
|
||||||
sourceElement.style.backgroundColor = color_red;
|
sourceElement.style.backgroundColor = color_red;
|
||||||
xmlData = "";
|
xmlData = "";
|
||||||
empty = true;
|
empty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
restRequest(port, endpoint, xmlData, "").then(function(result) {
|
restRequest(port, endpoint, xmlData, "").then(function (result) {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result.status == "OK") {
|
if (result.status == "OK") {
|
||||||
targetElement.value = result.result;
|
targetElement.value = result.result;
|
||||||
@@ -275,24 +308,24 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form REST request, send and return received data
|
* Form REST request, send and return received data
|
||||||
*
|
*
|
||||||
* @async
|
* @async
|
||||||
* @function
|
* @function
|
||||||
* @name restRequest
|
* @name restRequest
|
||||||
* @kind function
|
* @kind function
|
||||||
* @param {any} port of target service
|
* @param {any} port of target service
|
||||||
* @param {any} endpoint of target service
|
* @param {any} endpoint of target service
|
||||||
* @param {any} xmlData XML that will be sent
|
* @param {any} xmlData XML that will be sent
|
||||||
* @param {any} transformData data used to transform given XML
|
* @param {any} transformData data used to transform given XML
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
async function restRequest(port, endpoint, xmlData, transformData) {
|
async function restRequest(port, endpoint, xmlData, transformData) {
|
||||||
const escapeChar = "specialEscapeChar";
|
const escapeChar = "specialEscapeChar";
|
||||||
|
|
||||||
const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint;
|
const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint;
|
||||||
|
|
||||||
if(defaultStrings.includes(xmlData)){
|
if (defaultStrings.includes(xmlData)) {
|
||||||
xmlData = "<empty/>";
|
xmlData = "<empty/>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,10 +334,10 @@ async function restRequest(port, endpoint, xmlData, transformData) {
|
|||||||
// const url = addr.concat("?escapechar=", escapeChar, "&processor=", getProcInfo());
|
// const url = addr.concat("?escapechar=", escapeChar, "&processor=", getProcInfo());
|
||||||
|
|
||||||
var jsonData = JSON.stringify({
|
var jsonData = JSON.stringify({
|
||||||
"data" : xmlData,
|
"data": xmlData,
|
||||||
"process" : transformData,
|
"process": transformData,
|
||||||
"processor" : getProcessor(),
|
"processor": getProcessor(),
|
||||||
"version" : getVersion()
|
"version": getVersion()
|
||||||
});
|
});
|
||||||
// console.log(jsonData);
|
// console.log(jsonData);
|
||||||
var init = {
|
var init = {
|
||||||
@@ -318,7 +351,7 @@ async function restRequest(port, endpoint, xmlData, transformData) {
|
|||||||
|
|
||||||
|
|
||||||
var result = await fetch(request).then(response => {
|
var result = await fetch(request).then(response => {
|
||||||
return response.text().then(function(text) {
|
return response.text().then(function (text) {
|
||||||
return JSON.parse(text);
|
return JSON.parse(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
<!-- <link rel="stylesheet" href="common.css"> -->
|
<!-- <link rel="stylesheet" href="common.css"> -->
|
||||||
<link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
@@ -30,14 +29,14 @@
|
|||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="leftBar">
|
<div id="leftBar">
|
||||||
<ul id="toolList">
|
<ul id="toolList">
|
||||||
<li id="toolListRow" class="dynamic restTool" style="display: none;">
|
<li class="dynamic restTool toolListRow" style="display: none;">
|
||||||
<a id="rest-mock" href="http://tools.zipper.release11.com:8097/" target="iframe">REST Mock</a>
|
<a id="rest-mock" href="http://tools.zipper.release11.com:8097/" target="iframe">REST Mock</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="toolListRow" class="xmlTool"><a href="./tools/xpath.html" target="iframe">XPath</a></li>
|
<li class="toolListRow xmlTool"><a href="./tools/xpath.html" target="iframe">XPath</a></li>
|
||||||
<li id="toolListRow" class="xmlTool"><a href="./tools/xslt.html" target="iframe">XSLT</a></li>
|
<li class="toolListRow xmlTool"><a href="./tools/xslt.html" target="iframe">XSLT</a></li>
|
||||||
<li id="toolListRow" class="xmlTool"><a href="./tools/xsd.html" target="iframe">XSD</a></li>
|
<li class="toolListRow xmlTool"><a href="./tools/xsd.html" target="iframe">XSD</a></li>
|
||||||
<li id="toolListRow" class="xmlTool"><a href="tools/xmlFormatter.html" target="iframe">XML Formatter</a></li>
|
<li class="toolListRow xmlTool"><a href="tools/xmlFormatter.html" target="iframe">XML Formatter</a></li>
|
||||||
<li id="toolListRow" class="jsonTool" style="display: none;"><a href="tools/jsonFormatter.html" target="iframe">JSON Formatter</a></li>
|
<li class="toolListRow jsonTool" style="display: none;"><a href="tools/jsonFormatter.html" target="iframe">JSON Formatter</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="copyright">
|
<div id="copyright">
|
||||||
Build: [:VERSION:]<br>
|
Build: [:VERSION:]<br>
|
||||||
|
|||||||
@@ -4,9 +4,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- <link rel="stylesheet" href="../common.css"> -->
|
<!-- <link rel="stylesheet" href="../common.css"> -->
|
||||||
<!-- <link rel="stylesheet" href="styles.css"> -->
|
<!-- <link rel="stylesheet" href="styles.css"> -->
|
||||||
<script src="../assets/scripts/tools/jquery-3.6.0.slim.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="../assets/css/tools/r11form.css">
|
<link rel="stylesheet" href="../assets/css/tools/r11form.css">
|
||||||
<script src="../assets/scripts/tools/scripts.js"></script>
|
<script src="../assets/scripts/tools/scripts.js"> </script>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
</head>
|
</head>
|
||||||
@@ -131,7 +130,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[1.0] <a href="#" onClick="return false;"
|
[1.0] <a href="#" onClick="return false;"
|
||||||
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
|
class="hyperlink collapsible collapsibleMini collapseTrigger"><code>fn:position()</code></a>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -3384,16 +3382,12 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function processVersionSelector() {
|
function processVersionSelector() {
|
||||||
var processor = getProcessor();
|
var processor = getProcessor();
|
||||||
var hideableOptions = document.getElementsByClassName("hideable");
|
var hideableOptions = document.getElementsByClassName("hideable");
|
||||||
for (let i = 0; i < hideableOptions.length; i++) {
|
for (let i = 0; i < hideableOptions.length; i++) {
|
||||||
hideableOptions[i].style = "display: none;";
|
hideableOptions[i].style = "display: none;";
|
||||||
}
|
}
|
||||||
if (processor == "xalan" || processor == "libxml") {
|
if (processor == "xalan" || processor == "libxml") {
|
||||||
var xalanOptions = document.getElementsByClassName("xalan");
|
var xalanOptions = document.getElementsByClassName("xalan");
|
||||||
@@ -3432,7 +3426,7 @@
|
|||||||
showList(document.getElementsByName("collapse30"));
|
showList(document.getElementsByName("collapse30"));
|
||||||
showList(document.getElementsByName("collapse31"));
|
showList(document.getElementsByName("collapse31"));
|
||||||
console.log("collapsed 3.1");
|
console.log("collapsed 3.1");
|
||||||
} else if (filter == "collapse2.0"){
|
} else if (filter == "collapse2.0") {
|
||||||
document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions";
|
document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions";
|
||||||
showList(document.getElementsByName("collapse20"));
|
showList(document.getElementsByName("collapse20"));
|
||||||
hideList(document.getElementsByName("collapse30"));
|
hideList(document.getElementsByName("collapse30"));
|
||||||
@@ -3444,39 +3438,8 @@
|
|||||||
hideList(document.getElementsByName("collapse31"));
|
hideList(document.getElementsByName("collapse31"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (checkDefault(document.getElementById("xmlArea").value.trim()) || document.getElementById("xmlArea").value.trim() == "") {
|
|
||||||
// document.getElementById("defaultXMLButton").classList.toggle("active", true);
|
|
||||||
// } else {
|
|
||||||
// document.getElementById("defaultXMLButton").classList.toggle("active", false);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function getVersion() {
|
|
||||||
return document.getElementById("versions").value;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function getProcessor() {
|
|
||||||
return document.getElementById("processors").value;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function getProcInfo() {
|
|
||||||
var processVariables = document.getElementById("processors").value + "&version=" + getVersion();
|
|
||||||
return processVariables;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var triggerList = document.getElementsByClassName("collapseTrigger");
|
var triggerList = document.getElementsByClassName("collapseTrigger");
|
||||||
for (i = 0; i < triggerList.length; i++) {
|
for (i = 0; i < triggerList.length; i++) {
|
||||||
console.log("trigger connected");
|
console.log("trigger connected");
|
||||||
@@ -3519,13 +3482,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function init() {
|
function init() {
|
||||||
//Handle clicks in whole form and set info in tooltip
|
//Handle clicks in whole form and set info in tooltip
|
||||||
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
||||||
@@ -3564,8 +3521,8 @@
|
|||||||
processTooltip();
|
processTooltip();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="display-space-between">
|
<div class="display-space-between">
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<label for="processors">Select XSLT processor:</label>
|
<label for="processors">Select XSLT processor:</label>
|
||||||
<select name="processors" id="processors">
|
<select name="processors" id="processors">
|
||||||
<option value="xalan">Xalan</option>
|
<option value="xalan">Xalan</option>
|
||||||
<option value="libxml">libXML</option>
|
<option value="libxml">libXML</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="action-button active" id="clearXMLButton" style="padding: 3px 10px;"
|
<button class="action-button active" id="clearXMLButton" style="padding: 3px 10px;"
|
||||||
@@ -62,101 +62,20 @@
|
|||||||
<div class="tooltip-window rwd-hideable">
|
<div class="tooltip-window rwd-hideable">
|
||||||
<h2>What is XSD?</h2>
|
<h2>What is XSD?</h2>
|
||||||
<p><b>XSD is a W3C recomedation that specifies how to describe the elements in XML document</b></p>
|
<p><b>XSD is a W3C recomedation that specifies how to describe the elements in XML document</b></p>
|
||||||
<p>XSD specifies data types, order and arity of elements in XML file.<br>
|
<p>XSD specifies data types, order and arity of elements in XML file.<br>
|
||||||
Main components of XSD file are:<br>
|
Main components of XSD file are:<br>
|
||||||
- Element declaration - declares properties of elements (names and namespaces)<br>
|
- Element declaration - declares properties of elements (names and namespaces)<br>
|
||||||
- Attribute declarations - declares properties of attributes<br>
|
- Attribute declarations - declares properties of attributes<br>
|
||||||
- Simple and complex types:<br>
|
- Simple and complex types:<br>
|
||||||
- - XSD provides 19 simple data types<br>
|
- - XSD provides 19 simple data types<br>
|
||||||
- - More complex types are declared using simple types and relationships<br>
|
- - More complex types are declared using simple types and relationships<br>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <script>
|
|
||||||
function getVersion() {
|
|
||||||
return document.getElementById("versions").value;
|
|
||||||
}
|
|
||||||
</script> -->
|
|
||||||
<script>
|
|
||||||
function processTooltip() {
|
|
||||||
console.log("processTooltip");
|
|
||||||
|
|
||||||
|
|
||||||
if (getProcInfo() == "xalan") {
|
|
||||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
|
||||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
|
||||||
hideList(document.getElementsByName("collapse30"));
|
|
||||||
} else {
|
|
||||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
|
|
||||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
|
|
||||||
showList(document.getElementsByName("collapse30"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getProcessor() {
|
|
||||||
return document.getElementById("processors").value;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getVersion() {
|
|
||||||
if (getProcInfo() == "xalan") {
|
|
||||||
return "1.0";
|
|
||||||
} else {
|
|
||||||
return "3.0";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getProcInfo() {
|
|
||||||
var processVariables = document.getElementById("processors").value;// + "&version=" + document.getElementById("versions").value;
|
|
||||||
return processVariables;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var triggerList = document.getElementsByClassName("collapseTrigger");
|
|
||||||
for (i = 0; i < triggerList.length; i++) {
|
|
||||||
console.log("trigger connected");
|
|
||||||
triggerList[i].addEventListener("click", function () {
|
|
||||||
console.log("click");
|
|
||||||
var collapsible = this.parentElement;
|
|
||||||
var collapsibleData = this.nextElementSibling;
|
|
||||||
if (collapsibleData.style.maxHeight > "0px") {
|
|
||||||
collapsibleData.style.maxHeight = "0px";
|
|
||||||
|
|
||||||
this.classList.toggle("active", false);
|
|
||||||
if (!this.classList.contains("collapsibleMini")) {
|
|
||||||
collapsible.classList.toggle("active", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
var subLists1 = collapsibleData.getElementsByClassName("content");
|
|
||||||
var subLists2 = collapsibleData.getElementsByClassName("active");
|
|
||||||
for (j = 0; j < subLists1.length; j++) {
|
|
||||||
subLists1[j].style.maxHeight = "0px";
|
|
||||||
}
|
|
||||||
for (j = 0; j < subLists2.length; j++) {
|
|
||||||
subLists2[j].classList.toggle("active", false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
|
|
||||||
|
|
||||||
this.classList.toggle("active", true);
|
|
||||||
if (!this.classList.contains("collapsibleMini")) {
|
|
||||||
collapsible.classList.toggle("active", true);
|
|
||||||
} else {
|
|
||||||
var parentContent = this.closest(".content");
|
|
||||||
parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function init() {
|
function init() {
|
||||||
//Handle clicks in whole form and set info in tooltip
|
//Handle clicks in whole form and set info in tooltip
|
||||||
@@ -176,6 +95,22 @@
|
|||||||
// console.log("clock");
|
// console.log("clock");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function processTooltip() {
|
||||||
|
console.log("processTooltip");
|
||||||
|
|
||||||
|
|
||||||
|
if (getProcessor() == "xalan") {
|
||||||
|
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
||||||
|
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
||||||
|
hideList(document.getElementsByName("collapse30"));
|
||||||
|
} else {
|
||||||
|
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
|
||||||
|
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
|
||||||
|
showList(document.getElementsByName("collapse30"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="display-space-between">
|
<div class="display-space-between">
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<label for="processors">Select XSLT processor:</label>
|
<label for="processors">Select XSLT processor:</label>
|
||||||
<select name="processors" id="processors">
|
<select name="processors" id="processors">
|
||||||
<option value="saxon">Saxon</option>
|
<option value="saxon">Saxon</option>
|
||||||
<option value="xalan">Xalan</option>
|
<option value="xalan">Xalan</option>
|
||||||
<option value="libxml">libXML</option>
|
<option value="libxml">libXML</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="action-button active" id="clearXMLButton" style="padding: 3px 10px;"
|
<button class="action-button active" id="clearXMLButton" style="padding: 3px 10px;"
|
||||||
@@ -57,7 +57,8 @@
|
|||||||
|
|
||||||
<label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label>
|
<label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label>
|
||||||
<textarea disabled id="resultArea" name="resultArea" rows="10"
|
<textarea disabled id="resultArea" name="resultArea" rows="10"
|
||||||
class="textarea-300 bordered-field vertically-resizeable max-width" style="margin-bottom: 50px;" ></textarea>
|
class="textarea-300 bordered-field vertically-resizeable max-width"
|
||||||
|
style="margin-bottom: 50px;"></textarea>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1135,17 +1136,10 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <script>
|
|
||||||
function getVersion() {
|
|
||||||
return document.getElementById("versions").value;
|
|
||||||
}
|
|
||||||
</script> -->
|
|
||||||
<script>
|
<script>
|
||||||
function processTooltip() {
|
function processTooltip() {
|
||||||
console.log("processTooltip");
|
console.log("processTooltip");
|
||||||
|
if (getProcessor() == "xalan" || getProcessor() == "libxml") {
|
||||||
|
|
||||||
if (getProcInfo() == "xalan" || getProcInfo() == "libxml") {
|
|
||||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
||||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
||||||
hideList(document.getElementsByName("collapse30"));
|
hideList(document.getElementsByName("collapse30"));
|
||||||
@@ -1155,29 +1149,7 @@
|
|||||||
showList(document.getElementsByName("collapse30"));
|
showList(document.getElementsByName("collapse30"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getProcessor() {
|
|
||||||
return document.getElementById("processors").value;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getVersion() {
|
|
||||||
if (getProcInfo() == "xalan") {
|
|
||||||
return "1.0";
|
|
||||||
} else {
|
|
||||||
return "3.0";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function getProcInfo() {
|
|
||||||
var processVariables = document.getElementById("processors").value;// + "&version=" + document.getElementById("versions").value;
|
|
||||||
return processVariables;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var triggerList = document.getElementsByClassName("collapseTrigger");
|
var triggerList = document.getElementsByClassName("collapseTrigger");
|
||||||
for (i = 0; i < triggerList.length; i++) {
|
for (i = 0; i < triggerList.length; i++) {
|
||||||
console.log("trigger connected");
|
console.log("trigger connected");
|
||||||
@@ -1214,9 +1186,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function init() {
|
function init() {
|
||||||
//Handle clicks in whole form and set info in tooltip
|
//Handle clicks in whole form and set info in tooltip
|
||||||
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
||||||
|
|||||||
Reference in New Issue
Block a user