2013-04-21 125 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');