About

<#TEMPLATE_INCLUDE_NINEPAGE_ABOUTME#>
  • Dec

    31

    function xmlTagsToLowerCase(xml:XML):XML {
     
     xml.setName(xml.name().toString().toLowerCase());
     
     for each (var attribute:XML in xml.@*) {
      attribute.setName(attribute.name().toString().toLowerCase());
     }
     
     for each (var child:XML in xml..*) {
      
      if (child.nodeKind() == "element") {
       
       child.setName(child.name().toString().toLowerCase());
       
       for each (attribute in child. @ *) {
        attribute.setName(attribute.name().toString().toLowerCase());
       }
      }
     }
     return xml;
    }
    var xml:XML = xmlTagsToLowerCase(new XML("<A C='D'><B>test</B></A>"));
    trace(xml);
    //Output: <a c="D"><b>test</b></a>