I'm looking at the documentation for these Web resources Stylesheet (XSL)
Reading the script.js example it shows an ActiveXObject that loads XML from file given the file's url.
I don't have a file. I have a formContext.getAttribute(<fieldname>).getValue() where the field contains the XML that I want to transform.
How do I satisfy an Msxml2.DOMDocument.6.0 with a "stream" rather than a filename/url?
thanks
I have qTransform.xslt and a sample of new_response saved to file referencing the xslt within stored on the file system. When I browse it, the results are as I desire. Now, how do I take it to CE? I've imported the javascript, an html, the CSS and the same xslt to CE web resources. Here is the javascript copied from the MS documentation where the most significant change is that instead of an xml file, I'm streaming the xml from field (dataXml.loadXml)
// JavaScript source code var Sdk = window.Sdk || {}; (function () { this.formOnLoad = function (ExecutionContext) { var formContext = ExecutionContext.getFormContext(); var doing = formContext.ui.getFormType(); Sdk.QADlog = { dataFile = formContext.getAttribute("new_response").getValue(), transformFile = "XSL/qTransform.xslt", showData = function () { if (this.dataFile) { var dataXml = new ActiveXObject("Msxml2.DOMDocument.6.0"); dataXml.async = false; dataXml.loadXML(this.dataFile); var transformXSLT = new ActiveXObject("Msxml2.DOMDocument.6.0"); transformXSLT.async = false; transformXSLT.load(this.transformFile); // Set the innerHTML of the results area to the output of the transformation. var resultsArea = document.getElementById("results"); resultsArea.innerHTML = dataXml.transformNode(transformXSLT); } } }; }; }).call(Sdk);Here's the html of the Webresource field on the form:
The field is blank. Can anyone tell me why? I welcome probing questions as I have no idea how to make this work.
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102