java - JDOM - lowercasing all attribute names -


I need to parse an XML, and change all attribute names for lowercase using JDOM. Is there a good way to do this?

So if I have:

  & lt; Record id = "1" name = "dom" /> & Lt; Record id = "2" neme = "bob" />   

It happens:

  & lt; Record id = "1" name = "dom" /> & Lt; Record id = "2" name = "bob" /> Using JDOM 2.0.2 you can probably use an XPath, and you can loop the names. The problem is that you can end up with a conflict, for example, an element has multiple properties that solve the names of the same name, such as 'id' and 'id' .... but such Something you probably won  
  XPathExpression   

If you do not want to use XPaths (it is also probably faster), you can loop off the line:

 for  ( Element E: Mydoc.getDescendants (filter.ment ()) {if (e.has attribute) (for attribute a: e.getAttributes ()) {a.setName (a.getName (). ToLowerCase () ); R}   

Comments