<..remove xmlns attributes supported from above..>
int m = s.indexOf(’>’);
char [] attrs = s.substring(0,m).toCharArray();
int result = qName.length()+1,
mark = result,
from=-1,
control = <.xmlns name.>;
char delimiter = ’ ’;
String name="";
for(int i=result; i<m; i++ ){
attrs[result++] = attrs[i];
switch( control ){
case <.xmlns name.>: { <.insert attribute name.> break; }
case <.xmlns quote.>: { <.insert attribute quote.> break; }
case <.xmlns value.>: { <.insert attribute value.> break; }
} }
s = (new String(attrs,0, Math.min(result,attrs.length)))
+ s.substring(m);
-_-_-
<..insert attribute name..>
if( attrs[i] == ’=’ ){
name = (new String(attrs,mark,result-mark-1)).trim();
control = <.xmlns quote.>;
}
-_-_-
<..insert attribute quote..>
if( (attrs[i] == ’"’) || (attrs[i] == ’\’’) ){
delimiter = attrs[i];
control = <.xmlns value.>;
from = result;
}
-_-_-
<..insert attribute value..>
if( attrs[i] == delimiter ){
if( name.startsWith("xmlns")
&& ((name.length() == 5) || (name.charAt(5) == ’:’)) ){
String value = (new String(attrs,from,result-from-1)).trim();
<.bool := xmlns active?.>
if( bool ){ result = mark; }
}
mark = result;
control = <.xmlns name.>;
}
-_-_-