2

我正在使用 QueryPath 来解析 Chimpmail 的电子邮件模板(https://github.com/mailchimp/Email-Blueprints),但是当我尝试附加一个带有“mc:repeatable”属性的 tr 时,我收到了这个错误:

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

有没有办法告诉 QueryPath 不要尝试解析命名空间?

4

1 回答 1

0

我设法通过添加所需的命名空间声明来解决这个问题,然后将其删除:

$el->append('<tr mc:repeatable="" xmlns:mc=http://doesntmatter.com"> [...] </tr>');
$el->removeAttr('xmlns:mc');
于 2014-05-15T18:22:16.047 回答