dataelements.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Dataelements</title>
  19. <!-- libs, do not modify -->
  20. <script type="text/javascript" src="http://localhost/js_libs/jquery.min.js"></script>
  21. <script type="text/javascript" src="http://localhost/js_libs/relaxngui.js"></script>
  22. <link rel="stylesheet" href="http://localhost/js_libs/relaxngui.css" type="text/css"/>
  23. <script type="text/javascript" src="http://localhost/js_libs/util.js"></script>
  24. <script type="text/javascript" src="http://localhost/js_libs/vkbeautify.js"></script>
  25. <!-- custom stuff, play arround -->
  26. <script type="text/javascript">
  27. $("body").ready(function(){
  28. $.ajax({
  29. type: "GET",
  30. url: "dataelements.rng",
  31. success: function(rng){
  32. $.ajax({
  33. type: "GET",
  34. url: "dataelements.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>