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

Am trying to understand the on-the-fly validaiton
behavior. Am afraid I may get Validation exceptions
when I am in the middle of constructing the Instance.
Let's add some Key constraints to the schema. Now,
will get an Validation exception if I were to complete
the definition of the Key (say, made up of 4 elements)
at different times (meaning I may not define all at
once but definitely before the exit from app). How
would one let know the on-the-fly validator about this
so that we don't get premature exceptions?
In other words, Is it that you need to take lot of
precautions while doing this live validatio (like
adding dummy root closing tag,etc)?

-D
--- "ovisvana@netzero.net" <ovisvana@netzero.net>
wrote:

> 
> Hi,
>    Do you mean validate when you mean 'validate' or
> only check the well-formedness. Validate implies
> that there's a DTD or schema associated with the XML
> against which you are checking the XML. Since you
> are doing on-the-fly, it means that at instances
> your XML could be "not well-formed" and the snippet
> is not wrapped in a root element as required for XML
> to be well-formed. If needed, you can wrap your XML
> with a dummy end tag and validate it against the
> schema or DTD. 
> 
> Regards,
> V.Omprakash
> http://ovisvana.blogspot.com
> 
> 
> ---------- Forwarded Message ----------
> 
> 
> 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.
> 
>  OR
> 
> 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.
> 
> OR
> 
> Does the application design needs to ensure that the
> generated XML is always valid?
> 
> -D
>


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Received on Friday, 21 December 2007 08:00:12 UTC