Open Wattaged opened 4 years ago
Putting plaintext ampersands in text (<book>Strunk & White</book>
) is illegal in XML. If you need to do it, there are two ways:
<book>Strunk & White</book>
or
<book><![CDATA[Strunk & White]]></book>
tw5-xml can handle either of these cases.
Unfortunately, it's not great about telling you why any particular XML document is bad, so sorry you had to take time to track this down. Problem is, the DOM engines on all the different browsers (and NodeJS) all handle erroneous XML in different ways, so that's a bag of cats I've been afraid to open.
Thanks for the explanation and remedies. Not looking to cause you work, leave those cats in the bag and I'll try your solutions. Thanks again.
Hi Flibbles Still enjoying your very useful plugin, thanks. Tried a template today and couldn't get it to work, after filtering through the xml content it seems the '&' ampersand was the problem. Tested and reproduced it on your demo site on 'Examples/Rendering/Process.xml' - if you put an & after Martha the template breaks. I've got urls in my xml content with '&' in so thought I'd raise it in case there was an easy fix. Otherwise still working well, thanks a lot.