473,890 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10346
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*******@veri zon.net> wrote in message
news:10******** *****@corp.supe rnews.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*******@yaho o.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*******@veri zon.net> wrote in message news:<10******* ******@corp.sup ernews.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*******@veri zon.net> wrote in message news:<10******* *****@corp.supe rnews.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.d td">
<personnel>

<person id="Big.Boss">
<name><family>B oss</family> <given>Big</given></name>
<email>ch***@fo o.com</email>
<link subordinates="o ne.worker two.worker three.worker four.worker
five.worker"/>
</person>

<person id="one.worker" >
<name><family>W orker</family> <given>One</given></name>
<email>on*@foo. com</email>
<link manager="Big.Bo ss"/>
</person>

<person id="two.worker" >
<name><family>W orker</family> <given>Two</given></name>
<email>tw*@foo. com</email>
<link manager="Big.Bo ss"/>
</person>

<person id="three.worke r">
<name><family>W orker</family> <given>Three</given></name>
<email>th***@fo o.com</email>
<link manager="Big.Bo ss"/>
</person>

<person id="four.worker ">
<name><family>W orker</family> <given>Four</given></name>
<email>fo**@foo .com</email>
<link manager="Big.Bo ss"/>
</person>

<person id="five.worker ">
<name><family>W orker</family> <given>Five</given></name>
<email>fi**@foo .com</email>
<link manager="Big.Bo ss"/>
</person>

</personnel>
DTD:

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

<!ELEMENT person (name,email*,ur l*,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
2648
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 twice and check that they match. Problem is script doesn't valide past username input and I dont know why!! If you don't enter a password it doesn't do the validation anymore, it just dies for some reason. I would greatly appreciate anyones help,...
5
3017
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 - A Proposal As we all know, one of the best things about python and other scripting languages is dynamic typing (yes I know it has advantages and disadvantages but I will not discuss them now). Dynamic typing allows us to change types of...
2
2061
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 python 2.4. Even for correct files, it shows a "Syntax checking error: Error checking syntax: retval = 128, stderr=" alert. For python 2.3 it works fine (modulo the new 2.4 syntax of course). Both 2.3 and 2.4 are built from source on Cygwin, not...
23
2549
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 by their authors. There are lots of them out there but this selection cuts out the junk. If you know of any other good books that are freely available please post a link to them here and I'll consider adding them to the site.
10
1401
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
1685
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
1658
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 there is an error best would be to know where. I did find PyParser_SimpleParseString which does return a node structure. If there is an error it seems to return NULL, while I did not find this documented. Th eproblem with this is that first I...
16
2644
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 where someone suggested to me I was spending too much time writing error messages, and that I was therefore missing the benefit of using a scripting language. The idea, apparently, is that the PHP interpreter writes all the error messages that are...
3
2471
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. After googling on this newsgroup, I have read several threads where is stated that the LBYL way of testing parameters is not a pythonic way to work, and that is preferable catch the exceptions generated trying to use an invalid parameter passed...
0
9978
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9630
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8016
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5849
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4270
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3276
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.