deleteNameSpace XML


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.