how to debug XML?

L

lkrubner

When I go to groups.google.com and run a search against the
comp.text.xml newsgroup, using the words "debug XML" as my search term,
the results that come up are either irrelevant are surprising old. Of
the top results that are relevant, one is from 1999 and the other is
from 2001. So let me ask the question again, what are people doing to
debug their XML? There are some validators online, is that what
everyone uses? Or do some IDE's have built-in abilities to test and
debug XML and DTDs?
 
A

Arturius mac Aidan

When I go to groups.google.com and run a search against the
comp.text.xml newsgroup, using the words "debug XML" as my search term,
the results that come up are either irrelevant are surprising old. Of
the top results that are relevant, one is from 1999 and the other is
from 2001. So let me ask the question again, what are people doing to
debug their XML? There are some validators online, is that what
everyone uses? Or do some IDE's have built-in abilities to test and
debug XML and DTDs?

There are dozens, if not hundreds of ways to answer this question. I have
traditionally used XEmacs with PSGML mode. That seems to be falling behind
the times. I hear nxml-mode works well, but I have not been able to make
much use of it yet. But (X)Emacs isn't really an editor, it's a form of
insanity. IOW, the learning curve is very steep, and it requires a whole
different way of thinking than the Mac/MS UI paradigm.

It sounds like you are very new to XML. Can you describe your platform,
your current tools, your immediate objectives, etc., so that others can
provide more specific and helpful answers?
 
P

Peter Flynn

When I go to groups.google.com and run a search against the
comp.text.xml newsgroup, using the words "debug XML" as my search
term, the results that come up are either irrelevant are surprising
old. Of the top results that are relevant, one is from 1999 and the
other is from 2001. So let me ask the question again, what are people
doing to debug their XML? There are some validators online, is that
what everyone uses? Or do some IDE's have built-in abilities to test
and debug XML and DTDs?

"Debug" is an unusual word to use in connexion with XML, which is why
you find some rather strange links. XML is not a programming language,
so it doesn't have "bugs" in the sense that a program might. There are
two related types of error that do occur in XML, however:

a) conceptual errors in the construction of DTDs or Schemas
b) well-formedness or validity errors in the document

Type (a) is usually down to a misunderstanding of the nature of markup.
Some people want to model data in unusual, perverse, or vexatious ways
(even CS people who ought to know better :) but mostly there are good
tools for creating Schemas and DTDs built into IDEs and editors which
allow you to test their syntactic validity even if they allow semantic
nonsense.

Type (b) is tested with standard parsing and validation tools, either
standalone (from the console command line) or built into the interface
of whatever editor or other IDE you are using.

///Peter
 
M

Malcolm Dew-Jones

(e-mail address removed) wrote:

: Peter Flynn wrote:
: > There are
: > two related types of error that do occur in XML, however:
: >
: > a) conceptual errors in the construction of DTDs or Schemas
: > b) well-formedness or validity errors in the document
: >
: > Type (a) is usually down to a misunderstanding of the nature of markup.
: > Some people want to model data in unusual, perverse, or vexatious ways
: > (even CS people who ought to know better :) but mostly there are good
: > tools for creating Schemas and DTDs built into IDEs and editors which
: > allow you to test their syntactic validity even if they allow semantic
: > nonsense.
: >
: > Type (b) is tested with standard parsing and validation tools, either
: > standalone (from the console command line) or built into the interface
: > of whatever editor or other IDE you are using.

: I guess I meant, party, option B, and then I guess I also meant the PHP
: code that might generate some XML. But I suppose that is a PHP
: question. I was thinking about well-formedness, for sure, but also
: enforcement of a scheme. Like, if a DTD says only one thing is allowed
: in a field, and something else gets in there. I suppose that is
: well-formedness too?

enforcement of a scheme = validation

You want a "validating parser".

Xerces is one such parser. Not sure about php specific tools.
 
L

lkrubner

Peter said:
There are
two related types of error that do occur in XML, however:

a) conceptual errors in the construction of DTDs or Schemas
b) well-formedness or validity errors in the document

Type (a) is usually down to a misunderstanding of the nature of markup.
Some people want to model data in unusual, perverse, or vexatious ways
(even CS people who ought to know better :) but mostly there are good
tools for creating Schemas and DTDs built into IDEs and editors which
allow you to test their syntactic validity even if they allow semantic
nonsense.

Type (b) is tested with standard parsing and validation tools, either
standalone (from the console command line) or built into the interface
of whatever editor or other IDE you are using.

I guess I meant, party, option B, and then I guess I also meant the PHP
code that might generate some XML. But I suppose that is a PHP
question. I was thinking about well-formedness, for sure, but also
enforcement of a scheme. Like, if a DTD says only one thing is allowed
in a field, and something else gets in there. I suppose that is
well-formedness too?
 
P

Peter Flynn

Peter Flynn wrote: [...]
Type (b) is tested with standard parsing and validation tools, either
standalone (from the console command line) or built into the
interface of whatever editor or other IDE you are using.

I guess I meant, party, option B, and then I guess I also meant the
PHP code that might generate some XML. But I suppose that is a PHP
question. I was thinking about well-formedness, for sure, but also
enforcement of a scheme. Like, if a DTD says only one thing is allowed
in a field, and something else gets in there. I suppose that is
well-formedness too?

No, that's a validity error unless the something-else is malformed.

For example, if the DTD says element type A can only contain an
instance of element type B, and your file has

<A><B>text</B><C>text</C></A>

then that is a validity error. It's well-formed, but it conflicts
with the DTD.

If, on the other hand, it said <A><B>text</B><C>text<C></A> then
that is not well-formed, and it's an error regardless of whether
you use a DTD or not.

///Peter
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top