File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes beginner DTD question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "beginner DTD question" Watch "beginner DTD question" New topic

beginner DTD question

Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
I understand the basic concept that DTDs used for XML validation. However, it seemds kinda odd that it's the xml document that will refer to the DTD thru the DOCTYPE element. Let's say the sender and the receiver agree upon a specific format for the xml document they exchange, and the receiver can validate the xml document, using an agreed upon DTD. Now, if the sender sends an xml document that does NOT include a DOCTYPE element, the receiver can no longer validate the document, and whole purpose of defining the DTDs is defeated. Doesn't it make more sense to send the DTD as a parameter to the validating parser, and have the parser validate the xml document? Am I missing some thing?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Moving this thread to the XML and Related Technologies forum since it's not about XML Certification. Please continue the discussion over there.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
I'd really appreciate it if some one can answer this question. Thanks.
Charles McGuire
Ranch Hand

Joined: Jan 18, 2005
Posts: 99
I love JavaRanch, but the XML forum is pretty quiet. A lot of XML questions seem to go unanswered here. Try this site:
IBM DeveloperWorks XML Tips

There's no place like
Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
Thank you. Will try my luck there.
I agree. Here's the link:
subject: beginner DTD question
jQuery in Action, 3rd edition