xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: Forcing validation to a particular DTD
Date Tue, 06 Nov 2001 00:16:55 GMT
I've just completed some utility code that solves this problem, by
allowing pre-parse manipulation of the DOCTYPE declaration:


The javadocs explain the use cases (like your situation) and how to use
the code:


Yesterday I proposed on the jakarta-commons list that it be further
developed there. Anyway, it's good to know that there *is* a potential
user base ;)


On Mon, Nov 05, 2001 at 12:44:54PM -0500, Scott Dewitt wrote:
> I have asked this question before but did not get a response.  Am I sending
> this to the correct address?
> I have a situation that I would think is not that uncommon.  I have a UI
> tooling application that works on XML documents using a particular
> vocabulary.   These documents are consumed by a runtime engine that does
> not do validation.  However, I would like to make sure when opening a
> document that it conforms to the grammar for this vocabulary so that I can
> intelligently notify the user if the document is not of the correct type.
> If it does not validate, I will not work on it.  The problem is that the
> tool can open existing files created outside of the tool that may not have
> a DOCTYPE at all but nonetheless are still valid when used at runtime
> (since no validation is performed).  So, if I open a file that has no
> DOCTYPE, I'd like to force it to be validated against my DTD.  Ideally, I'd
> actually like to be able to validate all files that I open against my DTD
> and if they don't conform, inform the user that the file is unusable.
> Validation/revalidation, however, is not something that current versions of
> Xerces excel at.  There doesn't seem to be a way to do what I need to do
> without somehow inserting my own DTD statement before the document is
> parsed or to parse the document first, insert my DTD and then reparse with
> validation on.
> So my question are.
> 1) Is there a more elegant solution?
> 2) If not, will DOM3 address such issues?
> 3) Is there a better way to do this with Schemas, i.e. are they more
> appropriate?
> Thanks,
> Scott DeWitt
> -==================================================-
> Scott DeWitt                IBM WebSphere Transcoding Publisher
> dewittsc@us.ibm.com
> (919) 486.1919   t/l 526.1919
> Space may be the final frontier,
> but it's made in a Hollywood basement...
>   - Chili Peps
> -==================================================-

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message