rngtest4.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!--
  2. This file is part of RelaxNGui.
  3. RelaxNGui is free software: you can redistribute it and/or modify it under
  4. the terms of the GNU General Public License as published by the Free Software
  5. Foundation, either version 3 of the License, or (at your option) any later
  6. version.
  7. RelaxNGui is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  9. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License along with
  11. RelaxNGui (file COPYING in the main directory). If not, see
  12. <http://www.gnu.org/licenses/>.
  13. -->
  14. <!DOCTYPE html>
  15. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  16. <head>
  17. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  18. <title>RelaxNGui Test 4</title>
  19. <!-- libs, do not modify -->
  20. <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
  21. <script type="text/javascript" src="/js_libs/util.js"></script>
  22. <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
  23. <script type="text/javascript" src="relaxngui.js"></script>
  24. <link rel="stylesheet" href="relaxngui.css" type="text/css"/>
  25. <!-- custom stuff, play arround -->
  26. <script type="text/javascript">
  27. $("body").ready(function(){
  28. $.ajax({
  29. type: "GET",
  30. url: "rngtest4.rng",
  31. success: function(rng){
  32. $.ajax({
  33. type: "GET",
  34. url: "rngtest4.xml",
  35. success: function(data){
  36. var rngui = new RelaxNGui(rng,$('#show'));
  37. rngui.content(data);
  38. $('#saveall').on('click',function(){
  39. console.log($(rngui.save()).serializePrettyXML());
  40. });
  41. }
  42. });
  43. }
  44. });
  45. });
  46. </script>
  47. </head>
  48. <body>
  49. <div id="show"></div>
  50. <button id='saveall'>save it all to console</button>
  51. </body>
  52. </html>