Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint XML Schema    Handle conditional tags in Schema

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Sri
Junior Member
Posted
Hi

I am new to XML Schema and new to this forum.

I have the following requirement.

I have to validate tags present in an XML instance conditionally using a Schema.

My actual requirement can be explained with the example given below.

Say I have tags NAME, STATUS, SPOUSE_NAME, CHILDREN

My Schema should work as follows.

1. NAME must be present.

2. STATUS must be present and it can take values MARRIED, UNMARRIED

3. If STATUS is MARRIED then

* SPOUSE_NAME must be present

* CHILDREN is optional

4. If CHILDREN is present then

* SPOUSE_NAME must be present

* STATUS must be present and it must be MARRIED

5. SPOUSE_NAME and CHILDREN can occur in any sequence

6. If STATUS is UNMARRIED then

* SPOUSE_NAME must be absent

* CHILDREN must be absent

Can anybody help me in preparing a schema which validates all the above rules.

Thanks in advance
Sri
 
Posts: 2 | Registered: December 30, 2005Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
Hi Sri,

Have you got this issue resolved? I try to do something similiar and not sure how to do it.

Thanks,
Tonhu
 
Posts: 1 | Registered: April 16, 2009Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint XML Schema    Handle conditional tags in Schema