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