Handling Invalid HTML
I am pulling in an external XML feed. The "description" node contains a CDATA section that contains invalid HTML. Cascade pulls the feed okay. But when I cannot view the compiled page in Cascade. I receive the error,
An error occurred: An error occurred during the parsing of the
assembled page XML: org.xml.sax.SAXParseException: The element type
"br" must be terminated by the matching end-tag "
"
Shouldn't content within a CDATA section be ignored by the parser?
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 27 Oct, 2014 06:53 PM
Hi Chris,
I believe when you use the
disable-output-escaping
attribute, the CDATA tags are omitted and the HTML tags are retained, which is resulting in the invalid XML in this case. I'm not too sure why the XSLT preview isn't kicking back the error as well, because Velocity is as I test for possible solutions.Do you have any control over the way the feed is generated? I tried using CDATA and code sections, and combinations of the two, but nothing seemed to work out. I'm not too sure what else you could do other than looking for certain tags and replacing them with a self-closing tag to avoid the invalid XML errors. I'll ask around to see if any one has any ideas as well.
Please let me know if you have any questions.
Thanks!
Ryan Griffith closed this discussion on 10 Nov, 2014 08:57 PM.