Well, the document most certainly isn't well-formed. see that litle < between 2 and 4? Yep, that's the culprit - the less-than sign should have been entity-ized by the feed, but it wasn't.
You are right, somehow my eyes glossed over that one. Thanks.
Posted by
Lance
on August 27, 2003 at 08:44 AM CDT
#
XOM is telling you something here that you really need to listen to. It is simply not legal to put a less than sign in raw, unescaped XML content, ever. If the user types in a less than sign, then you need to escape it. I'm not sure how your application works, but if you use XOM to create the xontent in the first place; i.e. something like:
Element element = new Element("content");
element.appendChild(userInputString);
then XOM will automatically escape the string for you. If you receive an "XML" document in which the < isn't escaped or hidden inside a CDATA section, then the document is malformed and no conformant XML parser will accept it. This is a deliberate design decision in XML which is inherited by all vocabularies that use XML including RSS.
Yes, of course you are right. However, I'm working from an example of "Atom" from DiveIntoMark. The example *isn't* valid XML - which is a fault of Atom or the example.
Posted by
Lance
on November 30, 2003 at 08:52 AM CST
#
Posted by Tassos Bassoukos on August 27, 2003 at 05:45 AM CDT #
Posted by Lance on August 27, 2003 at 08:44 AM CDT #
XOM is telling you something here that you really need to listen to. It is simply not legal to put a less than sign in raw, unescaped XML content, ever. If the user types in a less than sign, then you need to escape it. I'm not sure how your application works, but if you use XOM to create the xontent in the first place; i.e. something like:
Element element = new Element("content");element.appendChild(userInputString);
then XOM will automatically escape the string for you. If you receive an "XML" document in which the < isn't escaped or hidden inside a CDATA section, then the document is malformed and no conformant XML parser will accept it. This is a deliberate design decision in XML which is inherited by all vocabularies that use XML including RSS.
Posted by Elliotte Rusty Harold on November 30, 2003 at 06:30 AM CST
Website: http://www.cafeconleche.org/XOM/ #
Posted by Lance on November 30, 2003 at 08:52 AM CST #