rngtest1.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 1</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. function get_free_id() {
  28. return 'a1';
  29. }
  30. $("body").ready(function(){
  31. $.ajax({
  32. type: "GET",
  33. url: "rngtest1.rng",
  34. success: function(rng){
  35. $.ajax({
  36. type: "GET",
  37. url: "rngtest1.xml",
  38. success: function(data){
  39. var rngui = new RelaxNGui(rng,$('#show'));
  40. rngui.content(data);
  41. $('#saveall').on('click',function(){
  42. console.log($(rngui.save()).serializePrettyXML());
  43. });
  44. }
  45. });
  46. }
  47. });
  48. });
  49. </script>
  50. </head>
  51. <body>
  52. <div id="show"></div>
  53. <button id='saveall'>save it all to console</button>
  54. </body>
  55. </html>