Last post Oct 13, 2010 08:30 PM by mchinta
Oct 11, 2010 09:50 PM|mchinta|LINK
I have an XML file as follows: Just a sample file
The tag <Contact> can come any times in <Contacts>. i.e. User sends number of contact information. So we are not sure how many people information the client sends us. So, my requiremtn is:
Atleast 1 Contact tag <Type> data should be as 'B'. If user send, 10 Contact Info without Type B, we should not accept it.
If user sends 10 Contact with 1 Type B, then thats fine.
So, I need to check this condition at XSD itself. Contact Type is of string type. How can i Check this condition at XSD? how do i do this?
For Example, If its integer value: then I can use <enumeration value='0'> or <enumeration value='1'>. So it only allows either 0 or 1.
Like wise, is any available for string types?
Atleast 1 Type should be 'B'
Oct 12, 2010 10:26 PM|Decker Dong - MSFT|LINK
Maybe you should use something like"maxOccurs" or "minOccurs".
For more please see this:
Oct 13, 2010 08:30 PM|mchinta|LINK
maxOccurs, minOccurs does not suit my scenario. I should be looking for some other constraints