Question

I'm using QueryPath to parse Chimpmail's email templates (https://github.com/mailchimp/Email-Blueprints), but when I try to append a tr with a "mc:repeatable" attribute I get this error:

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

Is there a way to tell QueryPath not to try to parse namespaces?

Was it helpful?

Solution

I managed to work around this by adding the required namespace declaration, then removing it:

$el->append('<tr mc:repeatable="" xmlns:mc=http://doesntmatter.com"> [...] </tr>');
$el->removeAttr('xmlns:mc');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top