473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 10317
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.