[xsd-users] Re: Validation during serialization?

Ashok Nalkund ashoknn at qualcomm.com
Wed Jun 25 18:50:44 EDT 2008


Thanks Boris. Since I already provide deserialization functionality, I 
could use it as is to validate the generated xml. It may not be the most 
efficient way to implement, but an easy one. Also I might disable in the 
general run and have it conditionally enabled which will address 
efficiency to some extent.

Thanks for your ideas.

ashok

Boris Kolpackov wrote:
> Hi Ashok,
> 
> Ashok Nalkund <ashoknn at qualcomm.com> writes:
> 
>>   I am facing the exact problem that Timothy is facing. I tried to get
>> xsd to validate the object during serialization but no luck. Then I
>> found this post from last month on the users mailing list.
>>
>> Do you have an idea when the validation for serialization would be
>> available?
> 
> We plan to have a C++/Tree-like mapping with support for validation
> during serialization available in the next 3-4 months. However, it
> will first appear in XSD/e, our embedded systems offering.
> 
> There is also a workaround for the C++/Tree mapping that you can use
> in the meantime. It involves serializing the object model into XML
> and re-parsing the result (perhaps only to DOM or even using SAX)
> with validation enabled. One approach would be to serialize the
> document into an in-memory buffer, re-parse it (possibly using DOM
> or SAX parser for improved performance) to make sure it is valid,
> and then write it to its final destination (e.g., a file).
> 
> Finally, you may also find the following post useful. It analyzes
> possible use cases for in-memory or serialization-time validation
> and comes to the conclusion that generally the application can't
> really do anything about an invalid document except knowing that
> it is invalid:
> 
> http://www.codesynthesis.com/pipermail/xsd-users/2008-January/001443.html
> 
> Boris


-- 
DRM support: mediaflo.eng.drm.support at qualcomm.com
SCS support: mediaflo.openca.scs.support at qualcomm.com
OpenCas support: mediaflo.openca.headend.dev.support at qualcomm.com

What awful irony is this?
We are as gods, but know it not.

ATGATT: All The Gear All The Time!

Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/




More information about the xsd-users mailing list