Doing More With XML Schemas (part 2) (
Page 1 of 6 )
In this second part, find out how to derive new element types by constraining
existing ones, control access to your schema definitions, and redefine externally-provided
schemas in place.In the first part of this article, I spent a fair amount of time explaining the
difference between simple and complex types in an XML schema, demonstrating, with
examples, how to go about building both. I also showed you how complex types can
be extended to create new sub-types, and how this extensibility allows you to
add OO-like capabilities to your XML schema. Finally, I wrapped things up with
a quick look at how you can make your various schema definitions more maintainable
by organizing them into separate files.
In this article, I'll be continuing the discussion of type extension, demonstrating
how to derive new types by restricting (rather than extending) existing ones,
create abstract definitions and redefine existing types. Note that you'll need
to be up to speed on the material covered in the first part of this article in
order to understand the concepts discussed in this one - so if you're coming at
this from scratch, take some time out to get the basics down, and then flip the
page so we can get started.