<!--
  This file is part of RelaxNGui.

  RelaxNGui is free software: you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation, either version 3 of the License, or (at your option) any later
  version.

  RelaxNGui is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE. See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with
  RelaxNGui (file COPYING in the main directory).  If not, see
  <http://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>RelaxNGui Test 4</title>

    <!-- libs, do not modify -->
    <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
    <script type="text/javascript" src="/js_libs/relaxngui.js"></script>
    <link rel="stylesheet"        href="/js_libs/relaxngui.css" type="text/css"/>
    <script type="text/javascript" src="/js_libs/util.js"></script>
    <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>

    <!-- custom stuff, play arround  -->

    <script type="text/javascript">
      $("body").ready(function(){
        $.ajax({
          type: "GET",
          url: "rngtest4.rng",
          success: function(rng){
            $.ajax({
              type: "GET",
              url: "rngtest4.xml",
              success: function(data){
                var rngui = new RelaxNGui(rng,$('#show'));
                rngui.content(data);
                $('#saveall').on('click',function(){
                  console.log($(rngui.save()).serializePrettyXML());
                });
              }
            });
          }
        });
      });
    </script>
  </head>
  <body>
    <div id="show"></div>
    <button id='saveall'>save it all to console</button>
  </body>
</html>