XML-Schema

 view release on metacpan or  search on metacpan

docs/html/modules.html  view on Meta::CPAN

  class for facets and <a href="modules/XML/Schema/Facet/Builtin.html#HASH(0x87d1310)">XML::Schema::Facet::Builtin</a> defines 
  numerous facets built in to XML Schema.
</p>

<p> Complex types are... more complex.  They are used to represent
  elements that contain attributes and/or have non-character content,
  e.g. child-elements.  You define your own complex types, specifying
  the permitted attributes and the content model, including
  definitions of child elements, mixed/empty flags, and so on.
  We'll come back to this later.
</p>

<p> User defined simple and complex types are defined within a schema
  and remain local to the containing complex type in which they are
  defined or the schema as a whole if defined outside any complex
  type.  In other words, they are lexically scoped.  The <a href="modules/XML/Schema/Scope.html#HASH(0x84a7d3c)">XML::Schema::Scope</a> module implements a mixin class which
  various other modules such as <a href="modules/XML/Schema/Type/Complex.html#HASH(0x87d11cc)">XML::Schema::Type::Complex</a>  are derived from, to implement methods for registering and
  retrieving information about types as well as various other XML
  Schema components like element and attribute groups.
</p>

<p>
  Complimentary to that is the <a href="modules/XML/Schema/Scoped.html#HASH(0x87b4738)">XML::Schema::Scoped</a> module
  which also implements a mixin class but this time for the purpose of
  accessing type (and other information) from a scope. 
</p>

<p> This might all become a little clearer when we start to consider
  the <a href="modules/XML/Schema/Attribute.html#HASH(0x877b59c)">XML::Schema::Attribute</a> module.  Objects of this
  class are used to represent XML element attributes and define at
  least two items: their name and their type.  
</p>
<p>
  The type item may reference an <a href="modules/XML/Schema/Type/Simple.html#HASH(0x84a883c)">XML::Schema::Type::Simple</a>  object directly or, more frequently, it will contain the name of one
  of the 45 or so simple types inbuilt to XML Schema (e.g. integer,
  string, month) or the name of a user-defined simple type defined
  elsewhere.  When an attribute needs to fetch its type object, say to
  validate attributes provided in an instance document, it calls its
  type() method which is inherited from <a href="modules/XML/Schema/Scoped.html#HASH(0x877ecb0)">XML::Schema::Scoped</a>.
  This delegates the request to the scope to which it is bound, which in
  the case of an attribute, will be the complex type or attribute group
  in which it is defined.  The request may be delegated upwards and 
  outwards until the outermost scope of the schema document is reached.
  If the request cannot be serviced by that point then the name 
  specified does not match any defined simple type visible to the 
  attribute.
</p>
<p> 
  The benefits of this are twofold.  Firstly, you have the
  convenience of referencing types by names, rather than having to
  rely on passing references to type objects around.  Secondly, and
  perhaps more significantly, it means that you can use types before
  you define them, something which the XML Schema specification
  explicitly permits.  
</p>
<p> 
  Moving upwards from attributes, we have the 
  <a href="modules/XML/Schema/Attribute/Group.html#HASH(0x84a88f0)">XML::Schema::Attribute::Group</a> module which acts as a
  container for attributes.  Complex types use an attribute group
  to define their attributes.  They are also used to represent
  free-standing collections of attributes which can be relocated 
  into numerous different complex type definitions.
</p>
<p>
  The <a href="modules/XML/Schema/Type/Complex.html#HASH(0x87de208)">XML::Schema::Type::Complex</a> module implements the 
  complex types.  A complex type has an attribute group which defines
  the permitted attributes for the element and a content model which 
  specifies what other elements and/or character content the element
  may contain.  Complex types can nest indefinately within complex
  type.
</p>
<p>
  With a schema defined in terms of the above objects, a parser
  can be constructed as an object of the <a href="modules/XML/Schema/Parser.html#HASH(0x87f5ec0)">XML::Schema::Parser</a>  class which receives XML parse events from an expat XML parser
  instance and consults the schema to ensure that the document 
  being parser conforms to the structure permitted by the schema.
  In addition, the schema can be annotated with events that define
  a schedule of actions to be performed when instance documents are 
  parsed.  These are implemented by the <a href="modules/XML/Schema/Schedule.html#HASH(0x8793644)">XML::Schema::Schedule</a>  module.
</p>


</td>
</tr>
<!-- end of table content -->
</table>

<div align="center">
<small><b>Perl XML::Schema Documentation</b></small>
</div>
</body>
</html>



( run in 0.525 second using v1.01-cache-2.11-cpan-5511b514fd6 )