It's not a secret anymore!*
The moose likes XML and Related Technologies and the fly likes Validating parser with no DOCTYPE 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 "Validating parser with no DOCTYPE" Watch "Validating parser with no DOCTYPE" New topic
Author

Validating parser with no DOCTYPE

Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Is there a way to create a validating SAX parser for a document that doesn't have a DOCTYPE in it? I'm using Xerces, so any non-standard way of doing this may work for me, too. Thanks.
[ April 27, 2005: Message edited by: Nathaniel Stoddard ]

Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
In the little time I could muster, I read about this (in XML Bible & the Spec.) and I am not very convinced that you could do this.

Part of the DOCTYPE declaration is that you declare the root element. You don't have to declare the DTD. That you can just provide a URL and get away with. As far as the root element, if all of your XML files have the same root element, then maybe this is possible. I have some doubts that this is the case you are trying to solve.

My wish: I wish I had the time to just write up some sample XML files and try a few things, but well I am struggling to juggle things between work, life and the other.

Sorry if it sounds like I am venting, I wish I had a more concrete answer.

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating parser with no DOCTYPE
 
Similar Threads
DTD
.dtd files used in .tld files
DTD
External DTD
DTD validation