472,374 Members | 1,263 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Checking XML DTD syntax and validating XML

Does anyone know of a decent tool, preferably free, that will check and validate DTD syntax, to make sure that my DTD is correct?

The only tool that I have found thus far is the IBM visual DTD tool, which I do like, but is limited. Basically, your DTD is "good" when it parses... and I am not sure this is the best way to do it.

As for validation of XML, I have found a great tool, xmlvalid, here:
< http://www.elcel.com/products/xmlvalid.html >
Cliff
Jul 20 '05 #1
8 10251
Hi Cliff

xmlspy from altova is contains a DTD validator. Xmlspy is an excellent tool.
Unfortunately it is not free, however you may download a 30day trial from
their website.

/Sebastian www.tomac.se

"Clifford W. Racz" <ra*******@verizon.net> wrote in message
news:10*************@corp.supernews.com...
Does anyone know of a decent tool, preferably free, that will check and validate DTD syntax, to make sure that my DTD is correct?
The only tool that I have found thus far is the IBM visual DTD tool, which I do like, but is limited. Basically, your DTD is "good" when it parses...
and I am not sure this is the best way to do it.
As for validation of XML, I have found a great tool, xmlvalid, here:
< http://www.elcel.com/products/xmlvalid.html >
Cliff

Jul 20 '05 #2
Sebastian Tomac wrote:
xmlspy from altova is contains a DTD validator. Xmlspy is an excellent tool.
Unfortunately it is not free, however you may download a 30day trial from
their website.


You can get a free copy - the entry level "home" version at
http://www.altova.com/download_spy_home.html

Ghee
Jul 20 '05 #3
http://xmlvalidation.com should work, too, and for free.

Rainer
Ghee <gh*******@yahoo.co.uk> wrote in message news:<2i************@uni-berlin.de>...
Sebastian Tomac wrote:
xmlspy from altova is contains a DTD validator. Xmlspy is an excellent tool.
Unfortunately it is not free, however you may download a 30day trial from
their website.


You can get a free copy - the entry level "home" version at
http://www.altova.com/download_spy_home.html

Ghee

Jul 20 '05 #4
Thanks Rainer, but that only validates XML files, not DTD syntax checking.
Clifford

Rainer Typke wrote:
http://xmlvalidation.com should work, too, and for free.

Rainer

Jul 20 '05 #5
If you refer to a DTD in a checked XML document, the XML validator
asks you to upload that as well and also validates it, if I am not
mistaken.

Cheers,

Rainer

"Clifford W. Racz" <ra*******@verizon.net> wrote in message news:<10*************@corp.supernews.com>...
Thanks Rainer, but that only validates XML files, not DTD syntax checking.
Clifford

Rainer Typke wrote:
http://xmlvalidation.com should work, too, and for free.

Rainer

Jul 20 '05 #6
Oh, I see.

The tool does validate an uploaded XML Schema against the XML Schema definition (again, another schema).

The tool does not check DTD Syntax though. It treats it like and XSD and fails on the first entity.

Thanks though for the comment.
Rainer Typke wrote:
If you refer to a DTD in a checked XML document, the XML validator
asks you to upload that as well and also validates it, if I am not
mistaken.

Cheers,

Rainer

Jul 20 '05 #7
"Clifford W. Racz" <ra*******@verizon.net> wrote in message news:<10************@corp.supernews.com>...
....
The tool does validate an uploaded XML Schema against the XML Schema definition (again, another schema).

The tool does not check DTD Syntax though. It treats it like and XSD and fails on the first entity.

....

Well, you can't upload and check a DTD directly. But there is a way of
forcing the tool to actually perform a DTD syntax check: just write an
XML file that does nothing except for referring to your DTD and upload
it. The tool will then prompt you for the DTD, you can upload it in a
second step, and if there is a syntax error in your DTD, you will get
an error message. If the DTD is correct but your dummy XML file does
not conform to it, that fact will be reported after any errors in the
DTD.

This works for both DTDs and XSDs.

You can test this workaround by using an error-free pair of an XML and
DTD file (for example the files I will attach below), then insert a
syntax error in the DTD (for example, change an ATTLIST into an
ATLIST). The tool will then report that syntax error.

Hope this clears it up. I see that it would be a nice future feature
for the site to also offer syntax checks for DTD files without XML
files, so you are not forced to do that workaround.

Rainer

XML file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE personnel SYSTEM "personal.dtd">
<personnel>

<person id="Big.Boss">
<name><family>Boss</family> <given>Big</given></name>
<email>ch***@foo.com</email>
<link subordinates="one.worker two.worker three.worker four.worker
five.worker"/>
</person>

<person id="one.worker">
<name><family>Worker</family> <given>One</given></name>
<email>on*@foo.com</email>
<link manager="Big.Boss"/>
</person>

<person id="two.worker">
<name><family>Worker</family> <given>Two</given></name>
<email>tw*@foo.com</email>
<link manager="Big.Boss"/>
</person>

<person id="three.worker">
<name><family>Worker</family> <given>Three</given></name>
<email>th***@foo.com</email>
<link manager="Big.Boss"/>
</person>

<person id="four.worker">
<name><family>Worker</family> <given>Four</given></name>
<email>fo**@foo.com</email>
<link manager="Big.Boss"/>
</person>

<person id="five.worker">
<name><family>Worker</family> <given>Five</given></name>
<email>fi**@foo.com</email>
<link manager="Big.Boss"/>
</person>

</personnel>
DTD:

<?xml encoding="UTF-8"?>
<!ELEMENT personnel (person)+>

<!ELEMENT person (name,email*,url*,link?)>
<!ATTLIST person id ID #REQUIRED>
<!ATTLIST person note CDATA #IMPLIED>
<!ATTLIST person contr (true|false) 'false'>
<!ATTLIST person salary CDATA #IMPLIED>

<!ELEMENT name ((family,given)|(given,family))>

<!ELEMENT family (#PCDATA)>

<!ELEMENT given (#PCDATA)>

<!ELEMENT email (#PCDATA)>

<!ELEMENT url EMPTY>
<!ATTLIST url href CDATA 'http://'>

<!ELEMENT link EMPTY>
<!ATTLIST link manager IDREF #IMPLIED>
<!ATTLIST link subordinates IDREFS #IMPLIED>

<!NOTATION gif PUBLIC '-//APP/Photoshop/4.0' 'photoshop.exe'>
Jul 20 '05 #8
Rainer,
Ahh... I see what you are saying. This is effectively verifying syntax by failing if it doesn't parse in the XML validator. And, if it fails to parse, it throws an error and passes that along.

That is what I am doing now to check my DTDs. If this is the best I can do without spending hundreds of dollars on a program, then so be it. It always helps to have another data point...
Thanks,
Clifford

Rainer Typke wrote:
....

Well, you can't upload and check a DTD directly. But there is a way of
forcing the tool to actually perform a DTD syntax check: just write an
XML file that does nothing except for referring to your DTD and upload
it. The tool will then prompt you for the DTD, you can upload it in a
second step, and if there is a syntax error in your DTD, you will get
an error message. If the DTD is correct but your dummy XML file does
not conform to it, that fact will be reported after any errors in the
DTD.

This works for both DTDs and XSDs.

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Philip D Heady | last post by:
Hi, I'm validating a simple form for input via post ($PHP_SELF). Near the end I check for username and password. I'm using simple if, elseif, else statements. I require them to enter password...
5
by: Tongu? Yumruk | last post by:
I have a little proposal about type checking in python. I'll be glad if you read and comment on it. Sorry for my bad english (I'm not a native English speaker) A Little Stricter Typing in Python...
2
by: George Sakkis | last post by:
I downloaded the latest Komodo (3.1) and configured it for python 2.4 so that it doesn't show decorators and genexps as syntax errors, but background syntax checking doesn't seem to work at all for...
23
by: Carter Smith | last post by:
http://www.icarusindie.com/Literature/ebooks/ Rather than advocating wasting money on expensive books for beginners, here's my collection of ebooks that have been made freely available on-line...
10
by: Samir | last post by:
Say I have 4 forms, all four have different numbers of text boxes. is there a script that I can use to check to make sure everything on the form is not blank?
8
by: Dooglo | last post by:
How do I check to see if my textbox has a alpha character in it? I don't want alpha characters, numeric only. Thanks Dooglo
3
by: gaston.gloesener | last post by:
I am seeking for a method to parse single lines of Python code (infact they are only formulas, so I generate a line like RESULT=<formula>). I do only want to know if the syntax is correct and if...
16
by: lawrence k | last post by:
I've made it habit to check all returns in my code, and usually, on most projects, I'll have an error function that reports error messages to some central location. I recently worked on a project...
3
by: w.m.gardella.sambeth | last post by:
Hi all, I am more or less new to Python, and currently am making my first "serious" program. The application is a Clinical History manager (for my wife) which stores its data on a sqlite database....
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.