=head1 NAME

XML::Compile::Schema::Instance - Represents one schema

=head1 SYNOPSIS

 # Used internally by XML::Compile::Schema
 my $schema = XML::Compile::Schema::Instance->new($xml);

=head1 DESCRIPTION

This module collect information from one schema, and helps to
process it.

=head1 METHODS

=head2 Constructors

$obj-E<gt>B<new>(TOP, OPTIONS)

=over 4

Get's the top of an XML::LibXML tree, which must be a schema element.
The tree is parsed: the information collected.

 Option                --Default
 attribute_form_default  <undef>
 element_form_default    <undef>
 filename                undef
 source                  undef
 target_namespace        <undef>

. attribute_form_default => 'qualified'|'unqualified'

. element_form_default => 'qualified'|'unqualified'

=over 4

Overrule the default as found in the schema.  Many old schemas (like
WSDL11 and SOAP11) do not specify the default in the schema but only
in the text.

=back

. filename => FILENAME

=over 4

When the source is some file, this is its name.

=back

. source => STRING

=over 4

An indication where this information came from.

=back

. target_namespace => NAMESPACE

=over 4

Overrule or set the target namespace.

=back

=back

=head2 Accessors

$obj-E<gt>B<attributeGroups>

=over 4

Returns a list of all defined attribute groups.

=back

$obj-E<gt>B<attributes>

=over 4

Returns a lost of all globally defined attribute names.

=back

$obj-E<gt>B<complexTypes>

=over 4

Returns a list with all complexType names.

=back

$obj-E<gt>B<element>(URI)

=over 4

Returns one global element definition.

=back

$obj-E<gt>B<elements>

=over 4

Returns a list of all globally defined element names.

=back

$obj-E<gt>B<filename>

=over 4

=back

$obj-E<gt>B<groups>

=over 4

Returns a list of all defined model groups.

=back

$obj-E<gt>B<id>(STRING)

=over 4

Returns one global element, selected by ID.

=back

$obj-E<gt>B<ids>

=over 4

Returns a list of all found ids.

=back

$obj-E<gt>B<mergeSubstGroupsInto>(HASH)

=over 4

=back

$obj-E<gt>B<schemaInstance>

=over 4

=back

$obj-E<gt>B<schemaNamespace>

=over 4

=back

$obj-E<gt>B<simpleTypes>

=over 4

Returns a list with all simpleType names.

=back

$obj-E<gt>B<source>

=over 4

=back

$obj-E<gt>B<substitutionGroupMembers>(ELEMENT)

=over 4

The expanded ELEMENT name is used to collect a set of alternatives which
are in this substitutionGroup (super-class like alternatives). 

=back

$obj-E<gt>B<substitutionGroups>

=over 4

Returns a list of all named substitutionGroups.

=back

$obj-E<gt>B<targetNamespace>

=over 4

=back

$obj-E<gt>B<type>(URI)

=over 4

Returns the type definition with the specified name.

=back

$obj-E<gt>B<types>

=over 4

Returns a list of all simpleTypes and complexTypes

=back

=head2 Index

$obj-E<gt>B<find>(KIND, LOCALNAME)

=over 4

Returns the definition for the object of KIND, with LOCALNAME.

example: of find

 my $attr = $instance->find(attribute => 'myns#my_global_attr');

=back

$obj-E<gt>B<importLocations>(NAMESPACE)

=over 4

Returns a list of all schemaLocations specified with the import NAMESPACE
(one of the values returned by L<imports()|XML::Compile::Schema::Instance/"Index">).

=back

$obj-E<gt>B<imports>

=over 4

Returns a list with all namespaces which need to be imported.

=back

$obj-E<gt>B<includeLocations>

=over 4

Returns a list of all schemaLocations which where specified with include
statements.

=back

$obj-E<gt>B<printIndex>([FILEHANDLE], OPTIONS)

=over 4

Prints an overview over the defined objects within this schema to the
selected FILEHANDLE.

 Option       --Default
 kinds          <all>
 list_abstract  <true>

. kinds => KIND|ARRAY-of-KIND

=over 4

Which KIND of definitions would you like to see.  Pick from
C<element>, C<attribute>, C<simpleType>, C<complexType>, C<attributeGroup>,
and C<group>.

=back

. list_abstract => BOOLEAN

=over 4

Show abstract elements, or skip them (because they cannot be instantiated
anyway).

=back

=back

=head1 SEE ALSO

This module is part of XML-Compile distribution version 1.12,
built on January 11, 2010. Website: F<http://perl.overmeer.net/xml-compile/>

All modules in this suite:
L<XML::Compile>,
L<XML::Compile::SOAP>,
L<XML::Compile::SOAP12>,
L<XML::Compile::SOAP::Daemon>,
L<XML::Compile::Tester>,
L<XML::Compile::Cache>,
L<XML::Compile::Dumper>,
L<XML::Compile::RPC>,
and
L<XML::Rewrite>,
L<XML::ExistDB>,
L<XML::LibXML::Simple>.

Please post questions or ideas to the mailinglist at
F<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile>
For life contact with other developers, visit the C<#xml-compile> channel
on C<irc.perl.org>.

=head1 LICENSE

Copyrights 2006-2010 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://www.perl.com/perl/misc/Artistic.html>

