2013-04-21 128 views
2

我使用QueryPath來分析Chimpmail的電子郵件模板(https://github.com/mailchimp/Email-Blueprints),但是當我嘗試附加帶有「mc:repeatable」屬性的tr時,出現此錯誤:致命錯誤:未捕獲異常'QueryPath ParseException'命名空間錯誤:

Fatal error: Uncaught exception 'QueryPath\ParseException' with message 'DOMDocumentFragment::appendXML(): namespace error : Namespace prefix mc for repeatable on tr is not defined 

有沒有辦法告訴QueryPath不要試圖解析命名空間?

回答

0

我設法解決這個通過添加所需的命名空間聲明,然後將其取出:

$el->append('<tr mc:repeatable="" xmlns:mc=http://doesntmatter.com"> [...] </tr>'); 
$el->removeAttr('xmlns:mc');