Agreed.  To change the location or indeed content of a DTD you can use
EntityResolvers.

If you wanted to validate an XML document which had no DOCTYPE declaration
then you could use Sun's MSV library to validate it explicitly. There's an
example in src/samples/validate/JARVDemo.java that shows how to do this
kinda thing.

James
----- Original Message -----
From: "Brian Young" <[EMAIL PROTECTED]>
To: "Alain Schneble (Realize IT GmbH)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 11, 2002 7:18 PM
Subject: Re: [dom4j-user] validate an xml file against a different DTD


> This is somewhat similar to the question asked recently about not
> validating or validating against a DTD from an alternate location.  I
> think you'd have to write a custom entity resolver that had the logic to
> resolve the DTD in the document to another DTD that you specify in the
> resolver.  A re-direction, essentially.  This assumes you know what DTD
> you want to validate against ahead of time- once you parse the doc it is
> too late obviously since that is when validation happens.
>
> Cheers
> Brian
>
> Alain Schneble (Realize IT GmbH) wrote:
>
> >hi folks
> >
> >I've a basic question concerning the parsing and validation of xml-files.
> >
> >Is it possible to parse and validate an xml file against a DTD other than
the
> >one that ist declared (specified) in the DOCTYPE-declaration without
> >changing the original DOCTYPE-declaration ?
> >
> >can you help me?
> >
> >thanks
> >alain
> >
> >
> >
> >
> >
> >_______________________________________________
> >dom4j-user mailing list
> >[EMAIL PROTECTED]
> >https://lists.sourceforge.net/lists/listinfo/dom4j-user
> >
> >
>
>
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to