Both these problems can be addressed by defining the restrictions using assertions. I think this is how I would normally do it in XSD 1.1.