Validating SGML parser?

B

Benjamin Niemann

Hi,

does anyone know of a validating SGML parser in python (like
xmlproc.xmlval does for XML)? Goal is to validation HTML against the
DTD, similar to validator.w3.org, not all SGML obscurities are required.

If real SGML validation is no option, I could probably rewrite the HTML
to make it XML conformant and feed it into xmlval - but then I'll have
to find a way to map line/column numbers from error messages to
positions in the unmodified HTML. I leave this as an exercise for my
future self...

Greetings from Heidelberg, Germany
Benjamin Niemann
 
L

Leif K-Brooks

Benjamin said:
does anyone know of a validating SGML parser in python (like
xmlproc.xmlval does for XML)? Goal is to validation HTML against the
DTD, similar to validator.w3.org, not all SGML obscurities are required.

There are plenty of command-line tools for that. Why not use one of them
through Python?
 
B

Benjamin Niemann

Leif said:
There are plenty of command-line tools for that. Why not use one of them
through Python?
Portability. The current version (that works can handle XHTML variants)
works out of the box on Windows, Linux and probably everything else that
supports Python. Would be nice if it could stay this way...
 

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,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top