Re: [xsl] Query regarding validating XML with DTD

Subject: Re: [xsl] Query regarding validating XML with DTD
From: "Eric Bréchemier" <eric.brechemier@xxxxxxxxx>
Date: Thu, 27 Sep 2007 11:56:27 +0200
  Hello Deepak,

you (and your application) should not assume that data produced will
always be valid. The DTD is like a contract between you and the data
producer, that allows to check whether the received item matches the

You should definitely activate validation by default in production,
and I would even advise using stronger validation than DTD alone can
provide like XML Schema or RELAXNG.
For performance purpose, you could try to optimize the validation by
compiling the schema and keeping a pool of instances of the validator

Kind regards,

Eric Brichemier

On 9/27/07, Deepak Angeswar wrote:
> (...)
> My question is - is it necessary to validate the XML I receive from
> mobile-service-provider against the DTDs? Or can I assume that - since
> the XML was created by the same source who created the DTD; the XML
> would definitely adhere to the required rules set in the DTD?
> The reason is - I would be receiving loads and loads of such XML
> thro HTTP POST; if I am going to validate each such POST request against
> DTDs; it might be a huge performance issue!

Current Thread