XML::C...Spaces(3pm)
β¨ NAME β¨
XML::Compile::Schema::NameSpaces β Connect name-spaces from schemas. that's the whole vibe, bestie π
π¦ SYNOPSIS π¦
# Used internally by XML::Compile::Schema
my $nss = XML::Compile::Schema::NameSpaces->new;
$nss->add($schema);
π DESCRIPTION π
okay so this module is like the group chat moderator for a whole bunch of namespaces, collected from various schema files. Per XML namespace, it collects a list of fragments that contain definitions for that namespace, and each fragment comes from a different source. When you look up an element or type, it searches those fragments in reverse order β so the last definitions overrule the older definitions. no cap. π
π METHODS π
π Constructors π
$obj->new(%options)β constructor, duh. β¨
π Accessors π
$obj->add( $schema, [$schemas] )β AddXML::Compile::Schema::Instanceobjects to the internal knowledge of this object. slay.$obj->allSchemas()β Returns a list of all known schema instances. iconic.$obj->doesExtend($exttype, $basetype)β Returns true when$exttypeextends$basetype. fr fr.$obj->find($kind, $address|<$uri,$name>, %options)β Lookup the definition for the specified$kindof definition: the name of a global element, global attribute, attributeGroup or model group. The$addressis constructed as" {uri}name "or as separate$uriand$name.
here's the options table (header literally -Option --Default):
include_used=> BOOLEAN β default<true>
(yes, the default is <true> π
)
$obj->findID( $address|<$uri,$id> )β Lookup the definition for the specified id, which is constructed as" uri#id "or as separate$uriand$id.$obj->findSgMembers($class, $type)β Lookup the substitutionGroup alternatives for a specific element, which is an$type(element full name) of form" {uri}name "or as separate URI and NAME. Returned is an ARRAY of HASHes, each describing one type (as returned byfind()). periodt.$obj->findTypeExtensions($type)β This method can be quite expensive, with large and nested schemas. π (so be careful, bestie)$obj->importIndex(%options)β[1.41]Returns a HASH with namespaces which are declared in all currently known schema's, pointing to ARRAYs of the locations where the import should come from.
In reality, the locations mentioned are often wrong. But when you think you want to load all schema's dynamically at start-up (no, you do not want it but it is a SOAP paradigma) then you get that info easily with this method. π
$obj->list()β Returns the list of name-space URIs defined.$obj->namespace($uri)β Returns a list ofXML::Compile::Schema::Instanceobjects which have the$urias target namespace.$obj->printIndex( [$fh], %options )β Show all definitions from all namespaces, for debugging purposes, by default the selected. Additional%optionsare passed toXML::Compile::Schema::Instance::printIndex().
options table (header literally -Option --Default):
include_used=> BOOLEAN β default<true>β Show also the index from all the schema objects which are defined to be usable as well; which were included viause().namespace=> URI|ARRAY-of-URI β default<ALL>β Show only information about the indicate namespaces.
example:
my $nss = $schema->namespaces;
$nss->printIndex(\*MYFILE);
$nss->printIndex(namespace => "my namespace");
# types defined in the wsdl schema
use XML::Compile::SOAP::Util qw/WSDL11/;
$nss->printIndex(\*STDERR, namespace => WSDL11);
$obj->schemas($uri)β We need the name-space; when it is lacking then import must help, but that must be called explicitly.$obj->use($object)β Use any otherXML::Compile::Schemaextension as fallback, if thefind()does not succeed for the current object. Searches for definitions do not recurse into the used object.
Returns the list of all used OBJECTS. This method implements XML::Compile::Schema::useSchema(). π
π SEE ALSO π
This module is part of XML-Compile distribution version 1.64, built on October 21, 2024. Website: http://perl.overmeer.net/xml-compile/
π LICENSE π
Copyrights 2006-2024 by [Mark Overmeer <markov@cpan.org>]. 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 http://dev.perl.org/licenses/
and finally, this page came from <b>perl v5.40.0</b>, dated <b>2024-10-27</b>, and it's the <b>XML::C...Spaces(3pm)</b> manpage β User Contributed Perl Documentation, no less. stay iconic, bestie π
β¨π¦
π¦ where this page comes from
- debian trixie: libxml-compile-perl 1.64-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-compile-perl 1.64-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-compile-perl 1.64-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms