View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Ayhan Ulusoy > XML-Pastor-1.0.4 > XML::Pastor::Builtin


Annotate this POD


New  7
Open  1
View/Report Bugs


XML::Pastor::Builtin - Module that includes definitions of all XML::Pastor W3C builtin type classes .


This module is used internally by XML::Pastor. You do not normally know much about this module to actually use XML::Pastor. It is documented here for completeness and for XML::Pastor developers. Do not count on the interface of this module. It may change in any of the subsequent releases. You have been warned.


  use XML::Pastor::Builtin;


XML::Pastor::Builtin is a module that includes the definitions of the classes that represent the W3C builtin simple types. These builtin packages are either directly defined here in this module or otherwise they are used by this module so that you don't have to use them in your program once you use this module.

Each builtin type corresponds to a package. So this module defines multiple packages at once. In each of the packages, the XmlSchemaType class data accessor is set with an object of type XML::Pastor::Schema::SimpleType. This object contains the W3C facets that are used during xml validation, such as pattern, minInclusive, and so on. An internal facet called regex (not defined by W3C) is used to give the regex patterns that correspond to the builtin types. The regex facet will be guaranteed to be a Perl regex while the pattern facet (W3C) may divert from Perl regular expressions although they seem identical to me at this time.

All builtin classes descend from XML::Pastor::Builtin::SimpleType which itself descends from XML::Pastor::SimpleType.

There exist some ancestors for groupings of builtin types. For example, all numeric builtin types descend directly or indirecly from XML::Pastor::Builtin::Numeric.

Such groupings are listed below:


Below is an example of how the double type is defined in the XML::Pastor::Builtin::double package.

  package XML::Pastor::Builtin::double;
  our @ISA = qw(XML::Pastor::Builtin::Numeric);

  XML::Pastor::Builtin::double->XmlSchemaType( bless( {
                'class' => 'XML::Pastor::Builtin::double',
                'contentType' => 'simple',
                 'derivedBy' => 'restriction',
                 'name' => 'double|',
                 # Regex shamelessly copied from XML::Validator::Schema by Sam Tregar                 
                 'regex' => qr/^[+-]?(?:(?:INF)|(?:NaN)|(?:\d+(?:\.\d+)?)(?:[eE][+-]?\d+)?)$/,
               }, 'XML::Pastor::Schema::SimpleType' ) );


Below is a list of W3C builtin types defined either directly in this module, or used by it (and so made available through it).


There no known bugs at this time, but this doesn't mean there are aren't any. Note that, although some testing was done prior to releasing the module, this should still be considered alpha code. So use it at your own risk.

Note that there may be other bugs or limitations that the author is not aware of.


Ayhan Ulusoy <dev(at)ulusoy(dot)name>


  Copyright (C) 2006-2007 Ayhan Ulusoy. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


See also XML::Pastor, XML::Pastor::ComplexType, XML::Pastor::SimpleType

If you are curious about the implementation, see XML::Pastor::Schema::Parser, XML::Pastor::Schema::Model, XML::Pastor::Generator.

If you really want to dig in, see XML::Pastor::Schema::Attribute, XML::Pastor::Schema::AttributeGroup, XML::Pastor::Schema::ComplexType, XML::Pastor::Schema::Element, XML::Pastor::Schema::Group, XML::Pastor::Schema::List, XML::Pastor::Schema::SimpleType, XML::Pastor::Schema::Type, XML::Pastor::Schema::Object

syntax highlighting: