Posted By

darkbaron1912 on 03/04/11


Tagged

xml


Versions (?)

deleteNameSpace XML


 / Published in: ActionScript 3
 

  1. /**
  2.   * 名前空間を削除します
  3.   * @param オリジナルストリング(XML形式)
  4.   * @return namespace宣言を取り去ったXML
  5.   */
  6. private function deleteNameSpace(xmlText : String) : XML {
  7. // remove the namespaces from the string representation of the XML
  8. xmlText = xmlText.replace(new RegExp("xmlns[^\"]*\"[^\"]*\"", "gi"), "");
  9. xmlText = xmlText.replace(new RegExp("xsi[^\"]*\"[^\"]*\"", "gi"), "");
  10.  
  11. // set the string rep. of the XML back to real XML
  12. return new XML(xmlText);
  13. }

Report this snippet  

You need to login to post a comment.