var XMLParser=Editor.Parser=function(){var v={autoSelfClosers:{br:true,img:true,hr:true,link:true,input:true,meta:true,col:true,frame:true,base:true,area:true},doNotIndent:{pre:true,"!cdata":true}},C={autoSelfClosers:{},doNotIndent:{"!cdata":true}},s=v,w=false,x=function(){function j(a,d){var e=a.next();if(e=="<")if(a.equals("!")){a.next();if(a.equals("["))if(a.lookAhead("[CDATA[",true)){d(k("xml-cdata","]]\>"));return null}else return"xml-text";else if(a.lookAhead("--",true)){d(k("xml-comment","--\>"));
return null}else if(a.lookAhead("DOCTYPE",true)){a.nextWhileMatches(/[\w\._\-]/);d(k("xml-doctype",">"));return"xml-doctype"}else return"xml-text"}else if(a.equals("?")){a.next();a.nextWhileMatches(/[\w\._\-]/);d(k("xml-processing","?>"));return"xml-processing"}else{a.equals("/")&&a.next();d(m);return"xml-punctuation"}else if(e=="&"){for(;!a.endOfLine();)if(a.next()==";")break;return"xml-entity"}else{a.nextWhileMatches(/[^&<\n]/);return"xml-text"}}function m(a,d){var e=a.next();if(e==">"){d(j);return"xml-punctuation"}else if(/[?\/]/.test(e)&&
a.equals(">")){a.next();d(j);return"xml-punctuation"}else if(e=="=")return"xml-punctuation";else if(/[\'\"]/.test(e)){d(f(e));return null}else{a.nextWhileMatches(/[^\s\u00a0=<>\"\'\/?]/);return"xml-name"}}function f(a){return function(d,e){for(;!d.endOfLine();)if(d.next()==a){e(m);break}return"xml-attribute"}}function k(a,d){return function(e,t){for(;!e.endOfLine();){if(e.lookAhead(d,true)){t(j);break}e.next()}return a}}return function(a,d){return tokenizer(a,d||j)}}();return{make:function(j){function m(b){for(var c=
b.length-1;c>=0;c--)p.push(b[c])}function f(){m(arguments);q=true}function k(){m(arguments);q=false}function a(){g.style+=" xml-error"}function d(b){return function(c,l){if(l==b)f();else{a();f(arguments.callee)}}}function e(b,c){var l=s.doNotIndent.hasOwnProperty(b)||h&&h.noIndent;h={prev:h,name:b,indent:n,startOfLine:c,noIndent:l}}function t(b){return function(c,l){var i=b;if(i&&i.noIndent)return l;if(w&&/<!\[CDATA\[/.test(c))return 0;if(i&&/^<\//.test(c))i=i.prev;for(;i&&!i.startOfLine;)i=i.prev;
return i?i.indent+indentUnit:0}}function y(){return k(D,y)}function D(b,c){if(c=="<")f(E,z,A(o==1));else if(c=="</")f(F,d(">"));else{if(b=="xml-cdata"){if(!h||h.name!="!cdata")e("!cdata");if(/\]\]>$/.test(c))h=h.prev}else G.hasOwnProperty(b)||a();f()}}function E(b,c){if(b=="xml-name"){r=c.toLowerCase();g.style="xml-tagname";f()}else{r=null;k()}}function F(b,c){if(b=="xml-name"){g.style="xml-tagname";if(h&&c.toLowerCase()==h.name)h=h.prev;else a()}f()}function A(b){return function(c,l){if(l=="/>"||
l==">"&&s.autoSelfClosers.hasOwnProperty(r))f();else if(l==">"){e(r,b);f()}else{a();f(arguments.callee)}}}function z(b){if(b=="xml-name"){g.style="xml-attname";f(H,z)}else k()}function H(b,c){if(c=="=")f(B);else c==">"||c=="/>"?k(A):k()}function B(b){b=="xml-attribute"?f(B):k()}var u=x(j),g,p=[y],o=0,n=0,r=null,h=null,q,G={"xml-text":true,"xml-entity":true,"xml-comment":true,"xml-processing":true,"xml-doctype":true};return{indentation:function(){return n},next:function(){g=u.next();if(g.style=="whitespace"&&
o==0)n=g.value.length;else o++;if(g.content=="\n"){n=o=0;g.indentation=t(h)}if(g.style=="whitespace"||g.type=="xml-comment")return g;for(;;){q=false;p.pop()(g.style,g.content);if(q)return g}},copy:function(){var b=p.concat([]),c=u.state,l=h,i=this;return function(I){p=b.concat([]);o=n=0;h=l;u=x(I,c);return i}}}},electricChars:"/",configure:function(j){if(j.useHTMLKludges!=null)s=j.useHTMLKludges?v:C;if(j.alignCDATA)w=j.alignCDATA}}}();