We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › XMLElement() parser error messages
Page Index Toggle Pages: 1
XMLElement() parser error messages (Read 402 times)
XMLElement() parser error messages
Feb 5th, 2010, 8:29am
 
I've been trying to use XMLElement to parse a big XML file and occasionally it's throwing me errors. I've tracked down where some of the problems are occuring by hand, but I was hoping that I could pull out more descriptive error information with a catch(Exception e).

Is there a syntax for asking for the line number, and column where the XML is breaking?

This is an example of the sort of stuff that's breaking the parser (for the sake of context) Code:
<pagetext content="Neil said, &quot;How could this happen?&quot" /> 


If you know your HTML, the invalid syntax is that after that second &quot, someone forgot to put the semicolon at the end. In the grand scheme of things, I can't see why the parser wouldn't just load the string in between the double-quotes whether it was valid special-character-markup or not, but .. that's what happens. :/
Re: XMLElement() parser error messages
Reply #1 - Feb 5th, 2010, 9:27am
 
OK. I've determined at least that text inside of a <![CDATA[]]> is ignored in the parsing process.

http://www.w3schools.com/XML/xml_cdata.asp
Page Index Toggle Pages: 1