In either case, when I validated the xml it did not give me any error or warning.
 That shouldn't be the case. Both documents should be invalidated with the mention:
"...(organization | person) cannot be empty according to the DTD/Schema" or something of the kind.
 For tns:organization, there is nothing we you do except complying to the schema by adding its children tns:organizationName and tns:organizationId, one each of that order with the correct text types.
 For tns:person, you can adding the attribute xsi:nil="true" and the document would be validated. And that is the major aspect of what nullible attribute being true meant in the schema.
>and why did you all nill=true in xml instance ???
It would not be surprising if it is still not clear. You have to first validate your validation algorithm as you seem to suggest there were no error and warning in both of the original documents. That can't be true and in the case of tns:organization that is even obvious. Make sure that part it is clear to you and the part of nillable would have a chance to fit into the understanding more naturally.
If I can direct you to the documentation, that may be helpful with the concrete cases here you can have adequate focus.
2.6 Schema-Related Markup in Documents Being Validated
XML Schema: Structures introduces a mechanism for signaling that an element should be accepted as ·valid· when it has no content despite a content type which does not require or even necessarily allow empty content. An element may be valid without content if it has the attribute xsi:nil with the value true. An element so labeled must be empty, but can carry attributes if permitted by the corresponding complex type.
The xs:nullable="true" in the schema document precisely allow the element in the document to be validated to acquire the schema instance attribute xsi:nil. If further it is set to true, empty content of that element will be treated as valid despite the content model of that element in the schema document.
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss