Lets say that you are at receiving end of a data which has certain format. To interpret that, we can create our own type for reading such document.
For example lets say that the user telephone number sent in an xml document is in US telephone number format as in:
304-657-6062, or lets say that the data expected is a ss number with format like: xxx-xx-xxxx, in such case we have to create a simple type with our own name of the type which we can use directly in the definition of complexType, but if you are looking for how you can put certain format for the expected type, here is your answer:
in case the data expected is a telephone number, then the simple type xsd definition is as in the image above:
Thanks for reading,
~nirmal