Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: when to validate XML while being created programmatically..

From: "Andrew Welch" <andrew.j.welch@-----.--->
To: dave <ceek63@-----.--->
Date: 12/20/2007 10:23:00 AM
On 20/12/2007, dave <ceek63@y...> wrote:
> This is related to validating a brand new XML instance
> WHILE being created programmatically:
>  Do you generally perform validation at the very end
> of completely creating an XML instance? If Yes, how
> would you correct these validation errors
> programmatically? It looks like a daunting task.

I'm not sure how you'd correct them programamtically - it would be one
special app that could alter itself to generate valid XML after a
change to the schema :)


> Does it even make sense to perform on-the-fly
> validation while constructing a new XML instance? If
> Yes, how would you tell the system when the instance
> is even incrementally valid before turning ON the
> validation. I can imagine there must be an API to
> enable/disable on-the-fly validation during the
> creation of XML instance. I might be wrong as it may
> not make sense

Most validators are streaming validators, so if you provide the XML as
SAX events then you'll be validating on the fly.

If you don't want to do that then create the document first, then
reparse it to validate it.

It depends on your requirements which you do - if the XML is useless
if it fails validation then there's not much point in constructing the
entire document, but equally it can be useful to have well-formed XML
to analyze after a failure.


> Does the application design needs to ensure that the
> generated XML is always valid?

That's what the schema is for, isn't it?


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

From mike@s... Thu Dec 20 10:33:09 2007
Received: from aji.w3.org ([133.27.228.225]


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