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

Re: Required Field validation strategies

  • From: "Pete Cordell" <petexmldev@t...>
  • To: "J Siatkowski" <jason.siatkowski@g...>,<xml-dev@l...>
  • Date: Tue, 20 Mar 2007 20:14:39 -0000

Re:  Required Field validation strategies
Original Message From: "J Siatkowski" <jason.siatkowski@gmail....>

> The other issue, which I didn't discuss earlier because it might have
> been moot based on the first issue, is my handling of null fields. My
> schema does indeed have custom data types, i.e. string0to14, etc. It
> also has some enumeration types. The schema also enforces required
> fields, although I have been sorely tempted to remove this from the
> schema because I have not been able to successfully validate a file
> with nulls without adding xs:nil = "true" to the elements which I want
> to be null. Only a small amount of the fields are required, and
> therefore the size of the uploaded file could be a lot smaller if the
> customer wasn't required to include the tags for elements which have
> no value. In my tests, if I omitted the tag, the schema validation
> failed because the tags were out of order. I also tried specifying a
> default value for each field in the schema if it was null, but that
> did not work well at all for date fields. A problem which I learned
> was quite common from what I've read since then.


I'm afraid I missed your original message, so I haven't seen your schema. 
So apologies if this misses the point!

You can set the minOccurs attribute in the element decalrations to 0 if you 
want to specify an optional element.  Is that he sort of thing you are 
looking for?

Also, for default elements to take effect, an empty element must be present. 
Were you trying that?

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================

> I would like to still use the schema so I can continue to read the
> file into the dataset, but I think it would be useful to allow the
> customer to supply only the tags that actually have values while still
> performing required field validation.
>
> Is this an all or nothing situation? It seems my choices are to allow
> the schema to validate required fields and therefore require the
> customer to provide all tags even if the data is null, or I can remove
> required fields from the schema and just perform my validation in code
> after the schema validation is performed.
>
> Again, thanks for any advice,
> --Jason
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
> 




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.