I am trying to convert uppercase html attributes to lower case in order to make my document to meet XHTML 1.0 ADA compliancy standards.
But i am not able to get the desired output.Below is the code snippet i have used to do this operation.Please help me.
private static String LowerCaseAttributes(String htmlfile){
String[] attributes = new String[] {
"border-bottom", "margin", "padding","bgcolor","width", "border",
"style", "alt", "title", "for", "col", "header", "clear",
"colspan", "rows", "cols", "type", "name", "id", "target", "method"
};
for(String s1 : attributes){
htmlfile = htmlfile.replace(s1.toUpperCase() + "=", s1 + "=");
}
return htmlfile;
}
I think the problem is that you are using “=” in your replace method, when in your input it has “:”.
Try this: