transformDlg.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!--
  2. ##############################################################################
  3. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. ##############################################################################
  17. -->
  18. <html>
  19. <head>
  20. <title>XSL Transformer</title>
  21. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  22. <script type="text/javascript">
  23. function generateDocument()
  24. {
  25. var args = window.dialogArguments;
  26. //set document's title as "$argument [$command]"
  27. //
  28. //document.title = args['arg'] + ' [' + args['cmd'] + ']';
  29. //load xml document
  30. //
  31. var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
  32. xmlDoc.async = false;
  33. xmlDoc.load("/esp/files_/components.xml");
  34. //load xsl document (stylesheet) - must be a free threaded DOM document
  35. //
  36. var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
  37. xslDoc.async = false;
  38. xslDoc.validateOnParse = false;
  39. xslDoc.load("/esp/files_/tabularForm.xslt");
  40. //create an instance of a stylesheet object - to be used by an XSLT processor later
  41. var xslt = new ActiveXObject("Msxml2.XSLTemplate");
  42. xslt.stylesheet = xslDoc;
  43. //create an instance of XSLT processor
  44. var xslProcessor;
  45. xslProcessor = xslt.createProcessor();
  46. xslProcessor.input = xmlDoc;
  47. //assign parameters to be passed to the stylesheet
  48. xslProcessor.addParameter("Component", args['comp']);
  49. xslProcessor.addParameter("Command", args['cmd']);
  50. xslProcessor.addParameter("ArgsNodeName", args['arg']);
  51. xslProcessor.addParameter("ModalDlg", '1');
  52. //xslProcessor.addParameter("Operation", args['op']);
  53. //do the xsl transformation
  54. xslProcessor.transform();
  55. //write out the output as contents for the document
  56. //
  57. //todo: this makes the browser lose history so you can't go back!!
  58. //however, we don't care for this at this time since we are launching a modal dlg anyway
  59. //--
  60. document.write(xslProcessor.output);
  61. //we need to invoke the onLoadDlg() method of the new document until we figure out
  62. //which is a better notification to exploit there for initializing since document.write
  63. //does not reload the document.
  64. onLoadDlg();
  65. }
  66. </script>
  67. </head>
  68. <body bgcolor="#FFFFFF" bgproperties="fixed" onload="generateDocument()">
  69. </body>