XML syntax checking

947 views
Skip to first unread message

Lupus

unread,
Mar 26, 2009, 5:59:10 AM3/26/09
to BBEdit Talk
Is there a way within BBEdit to do basic validation of XML without a
DTD (ie check that it is 'well formed') through a mechanism like the
HTML syntax check button?

Cheers,

Joel

Dennis

unread,
Mar 26, 2009, 1:15:40 PM3/26/09
to bbe...@googlegroups.com

I'm not aware of a built-in way to do this. But I've been using the
BBEdit XML Tools scripts at:

http://dev.bugtree.com/

One script provides the option to check XML well-formedness without a
DTD.

-Dennis

Patrick Woolsey

unread,
Mar 26, 2009, 2:49:49 PM3/26/09
to bbe...@googlegroups.com
Dennis <arge...@mac.com> sez:


Thanks Dennis, you beat me to it. :-)


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048

Joel Smith

unread,
Mar 27, 2009, 6:46:42 PM3/27/09
to bbe...@googlegroups.com
I've tried using them, but they give a java error when I try to
execute them. I had thought that they might not work with the current
version of BB.

Cheers,

Joel

Dennis

unread,
Mar 30, 2009, 4:13:13 PM3/30/09
to bbe...@googlegroups.com
On Mar 27, 2009, at 3:46 PM, Joel Smith wrote:

> I've tried using them, but they give a java error when I try to
> execute them. I had thought that they might not work with the current
> version of BB.

They seem to work fine with BBEdit 9.1.1 (2328) here. Perhaps there's
a problem with your Java installation?

-Dennis

Semper Fidelis

unread,
Mar 30, 2009, 4:23:00 PM3/30/09
to bbe...@googlegroups.com
... and the added plug-in works fine with my version of BBEdit, which
is 8.2.6. A quick test of the script against one of my XML files
produces these messages:

* for the script XMLForm: "XML is well-formed."

* for the script XMLValidate: "XML is valid and well-formed."

= = = = = = = = = = = = = = = = = = = =

Nigel Stanger

unread,
Mar 30, 2009, 4:52:34 PM3/30/09
to bbe...@googlegroups.com
On 31/03/2009 9:13 AM, "Dennis" <arge...@mac.com> spake thus:

> They seem to work fine with BBEdit 9.1.1 (2328) here. Perhaps there's
> a problem with your Java installation?

With the same version of BBEdit, I get the following results:

The XMLForm script works fine if (a) there is no DTD specified or (b) the
DTD is specified by absolute path (or presumably (c), it can be found by
some sort of resolver). It fails if, for example, the DTD is in the same
directory as the XML file and is specified by a relative path. This appears
to be because the script _always_ creates a temporary file (why, I'm not
sure, and the comments imply that wasn't the original intent). The script
checks the temporary file, but the DTD is of course no longer there.

The XMLValidate script fails with a Java exception regardless of how the DTD
is specified. There's nothing unusual about my Java installation that I'm
aware of, except that I've changed my default JVM to 1.6 rather than 1.5.
However, changing back to 1.5 doesn't make any difference (and I need 1.6
for a particular piece of software I use frequently). The exception is
"java.lang.NoClassDefFoundError:
org/apache/xmlbeans/impl/tool/InstanceValidator".

--
Nigel Stanger, <http://www.business.otago.ac.nz/infosci/>
Dept. of Information Science, <http://xri.net/=nigel.stanger>
University of Otago, Dunedin, NEW ZEALAND. +64-3-479-8179

This sentenc containz three errors.

Reply all
Reply to author
Forward
0 new messages