[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: When to Validate XML?

  • From: Max Dunn <maxdunn@s...>
  • To: "'Magick, Brian'" <Brian.Magick@C...>, xml-dev@l...
  • Date: Wed, 31 Oct 2001 19:22:29 -0800

how to validate xml
Title: Message
A simple example where validation seems like it should always be done:  when an application that depends on its XML conforming to a particular schema receives XML from an external source.  In the real world, we receive XML purchase orders conforming to the cXML spec over HTTP from a different organization.  Validation quickly gets us started with the processing of the PO.
In such a case validation accomplishes the important task of assuring a basic level of conformance to some specs of the application, and typical applications will additionally check the message in ways that DTDs or Schemas couldn't necessarily help with, but that is not to say DTDs or Schemas are incomplete.
At the other end of the spectrum would be the pointless tactic of validating the same file validated 20 seconds ago, the same application validating the same file sitting on the same server. 
If you are talking about publisher and subscriber applications, the big question is how close are the two systems to each other?  What organization, what network, what machine, what file? It would range from two distinct applications at different organizations to two modules of a single application accessing a single file, and at the one extreme you should validate and the other you shouldn't.   
-----Original Message-----
From: Magick, Brian [mailto:Brian.Magick@C...]
Sent: Wednesday, October 31, 2001 6:25 PM
To: xml-dev@l...
Subject: When to Validate XML?

Anyone interested in sharing their thoughts on under what circumstances you should validate XML? 


I think this board has really had some good discussions lately (i.e. Database Decision Tree, Determining ID-ness in XML) and this is one issue that still seems to draw the most debate in the inner-circles of my company.


Some folks feel that validation should ALWAYS be done regardless of the circumstance (a bit radical it may seem). Others feel that XML validation is simply a waste of time.  Some groups feel that schemas are not advanced yet to do validation very intelligently (i.e. problems validating date formats), and that the applications are still the best choice to validate your data.  People involved with integration feel that if the publisher and the subscriber applications/databases BOTH do validation that XML validation is an extreme misuse of resources.  And on and on….


With out nit-picking the examples I just laid out on the table can we share some general thoughts on When to Validate and When Not to Validate XML?

Who knows, if this is a successful conversation perhaps we can give Leigh Dodds enough ammo for next week’s article. 



Brian Magick



Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.