How to test for JDOMExceptions in an XML file?

S

Steve

Hi;

I'm stuck occasionally making XML files that for various boring
reasons I can't test before putting it into production.

The last JDOMException I got complained about an extra (blank, I never
saw it ) line at the end of the file.

I tried running my XML file through the syntax checker at w3.org, but
it didn't catch it.

Is there a utility where I could feed my XML file into it and it would
check it as rigourously as the JDOM?

Thanks in advance

Steve
 
D

Donkey Hottie

Steve said:
Hi;

I'm stuck occasionally making XML files that for various
boring reasons I can't test before putting it into
production.

The last JDOMException I got complained about an extra
(blank, I never saw it ) line at the end of the file.

I tried running my XML file through the syntax checker at
w3.org, but it didn't catch it.

Is there a utility where I could feed my XML file into it
and it would check it as rigourously as the JDOM?

Thanks in advance

Steve

How many lines of Java code would it make to write such a tester using JDOM?

Just a thought.
 
M

Mike Schilling

Steve said:
Hi;

I'm stuck occasionally making XML files that for various boring
reasons I can't test before putting it into production.

The last JDOMException I got complained about an extra (blank, I
never
saw it ) line at the end of the file.

That should not cause a parsing error. See the XML spec at
http://www.w3.org/TR/REC-xml/

[1] document ::= prolog element Misc*
[3] S ::= (#x20 | #x9 | #xD | #xA)+
[27] Misc ::= Comment | PI | S

In other words, an XML document can end with an arbitrary amount of
whitespace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top