
(function($){var xml_dom;var xml_dom2;function fmt_xml(s){return s.replace(/> *</g,">\n<");}
$(document).ready(function(){$("#userAgent").text(navigator.userAgent);$(".test_out").text($(".test_wrapper").html());var xml_str="<root> "+"<elm> <h1>title</h1> <p>line 1</p> <p>line 2</p> <p>line 3</p> </elm> "+"<elm2> <p>line x</p> <p>line y</p> </elm2> "+"</root>";xml_dom=load_xml_content_string(xml_str);$(".test_out2").text(fmt_xml(serialize_xml(xml_dom)));var xml_str2="<ns:root xmlns:ns='!empty'> "+"<ns:elm> <ns:h1>title</ns:h1> <ns:p>line 1</ns:p> <ns:p>line 2</ns:p> <ns:p>line 3</ns:p> </ns:elm> "+"<ns:elm2> <ns:p>line x</ns:p> <ns:p>line y</ns:p> </ns:elm2> "+"</ns:root>";xml_dom2=load_xml_content_string(xml_str2);$(".test_out3").text(fmt_xml(serialize_xml(xml_dom2)));$(".fig_tbl tr").each(function(idx){var nodes=$(this).children();var out="err";try{out=eval(nodes.eq(0).text());}catch(e){}
nodes.eq(1).text(out);var expected=nodes.eq(2).text();if(nodes.eq(2).hasClass("exp")&&out!=expected){nodes.eq(0).addClass("err");nodes.eq(2).show().text("Should be "+expected);}});});})(jQuery);