XML Schma - Addiing optional fields
Posted: Fri Jul 08, 2005 6:08 am
I have the following XML
<request>
<system>ABC</system>
<id>XYZ123</id>
<dynamic>
<serial>
<id>X123456</id>
<id>A123456</id>
</serial>
<pool>
<id>y123456</id>
<id>d123456</id>
</pool>
</dynamic>
</request>
Now I need to conver the xml to XSD with the following business rule
<dynamic> element is optional field
if the <dynamic> field is defined it should have either one of these fields or both <serial> & <pool>
if <serial> or <pool> is defined it should have atleast one element <id>
I'm not sure how to convert the above xml to XSD and I tried couple of conversion tool and they do not have the options...
any help is appreciated.
<request>
<system>ABC</system>
<id>XYZ123</id>
<dynamic>
<serial>
<id>X123456</id>
<id>A123456</id>
</serial>
<pool>
<id>y123456</id>
<id>d123456</id>
</pool>
</dynamic>
</request>
Now I need to conver the xml to XSD with the following business rule
<dynamic> element is optional field
if the <dynamic> field is defined it should have either one of these fields or both <serial> & <pool>
if <serial> or <pool> is defined it should have atleast one element <id>
I'm not sure how to convert the above xml to XSD and I tried couple of conversion tool and they do not have the options...
any help is appreciated.