Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Why do we need XML Schemas other than for automatic validation?

From: "Duane" <nospam@---------.--->
To: NULL
Date: 7/9/2008 8:40:00 AM

"Neil Smith [MVP Digital Media]" <neil@n...> wrote in message
news:04o7741chg1eiclse7g53kknk6r4klh0gt@4......
>
> Well, we had to do that this month as part of our unit tests when
> migrating a web service from one version to a very much upgraded one.
>
> The schema was invaluable for providing confirmation of expectations
> that response elements corresponded between versions, and catching
> config settings which differed between the services (but should have
> matched).
>
> Although it was relatively time consuming to do, it added a great
> degree of confidence in the rollout procedure between the new and old
> systems to generate the service responses.
>
> Not all the possible conditions were possible to validate (easily)
> using the XSD, so additional validation using PHPUnit included MD5
> matching of nodesets, where our service responds with elements which
> aren't required to be in a specific order.
>
> Of course, it also allows customers to validate our response if they
> need to raise a maintenance ticket, so benefits all round.
>
> It also provided a degree of focus in discovering elements which were
> deprecated in the response but still being generated - when removing
> these items from the schema, the unit tests fail until the
> unneccessary code is completely removed, which helped in the upgrade.
>

Thanks for explaining that Niel.  I had never come across a good reason to
use DTDs or schemas.  I think I understand now.  It's not that it won't
work.  The reason one would create them (other than for the obvious reason
of validating various uncontrolled input sources) is much the same as
commenting code.  The main purpose is for maintenance.  And schemas can do
some automatic validation which comments can't.

So, if I understand it correctly, If I have a XML / XSL which I can see and
fully comprehend within a page or two, there is not much reason to create a
schema.  However, if it is a complex structure, creating a schema will not
necessarily help during the initial creation (other than maybe with thinking
it through), but will be helpful when changes are made in the future.  While
it may not catch all issues, it is another step in the process to catch as
many problems as possible.  It also would be useful if a new and unexpected
input source is put in place.

Duane



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent