XML::C...stance(3pm)
XML::C...stance(3pm) β hey bestie, welcome to the tea on XML::Compile::Schema::Instance! π
β¨ NAME β¨
XML::Compile::Schema::Instance β Represents one schema π¦
πΈ SYNOPSIS πΈ
# Used internally by XML::Compile::Schema
my $schema = XML::Compile::Schema::Instance->new($xml);
π¦ DESCRIPTION π¦
Okay so literally, this module is collecting all the info from one schema and helping you process it. That's the whole vibe. No cap. π
π METHODS π
π Constructors π
$obj->new($top, %options)
Gets the top of an XML::LibXML tree, which must be a schema element. The tree is parsed: the information collected. Like, it grabs the top node and does its thing. β¨
The table header is exactly -Option --Default β here's the whole thing, character for character:
-Option --Default
attribute_form_default <undef>
element_form_default <undef>
filename undef
source undef
target_namespace <undef>
Now let's break down every single one, no skipping:
attribute_form_default=>'qualified'|'unqualified'β 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.element_form_default=>'qualified'|'unqualified'β Same deets as above: 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.filename=>FILENAMEβ When the source is some file, this is its name.source=>STRINGβ An indication where this information came from.target_namespace=>NAMESPACEβ Overrule or set the target namespace.
π«Ά Accessors π«Ά
$obj->attributeGroups()β Returns a list of all defined attribute groups.$obj->attributes()β Returns a lost of all globally defined attribute names. (Yes, the original says "lost" β we're keeping that typo, it's iconic. π)$obj->complexTypes()β Returns a list with allcomplexTypenames.$obj->element($uri)β Returns one global element definition.$obj->elements()β Returns a list of all globally defined element names.$obj->filename()β no description in the original, just an accessor bestie.$obj->groups()β Returns a list of all defined model groups.$obj->schema()β no description given.$obj->schemaInstance()β no description given.$obj->schemaNamespace()β no description given.$obj->sgs()β Returns aHASHwith the base-type as key and anARRAYof types which extend it.$obj->simpleTypes()β Returns a list with allsimpleTypenames.$obj->source()β no description given.$obj->targetNamespace()β no description given.$obj->tnses()β A schema can defined more than one target namespace, where recent schema spec changes provide atargetNamespaceattribute. (Another lil typo, keeping it fr fr.)$obj->type($uri)β Returns the type definition with the specified name.$obj->types()β Returns a list of allsimpleTypesandcomplexTypes.
π₯ Index π₯
$obj->find($kind, $fullname)β Returns the definition for the object of$kind, with$fullname.
Example of find:
my $attr = $instance->find(attribute => '{myns}my_global_attr');
$obj->importLocations($ns)β Returns a list of allschemaLocationsspecified with the import$ns(one of the values returned byimports()).$obj->imports()β Returns a list with all namespaces which need to be imported.$obj->includeLocations()β Returns a list of allschemaLocationswhich where specified with include statements. (Yep, "where" instead of "were" β original typo, keeping it. π)$obj->printIndex( [$fh], %options )β Prints an overview over the defined objects within this schema to the selected$fh.
The table header is exactly -Option --Default β here's the option table:
-Option --Default
kinds <all>
list_abstract <true>
kinds=>KIND|ARRAY-of-KINDβ Which KIND of definitions would you like to see. Pick from"element","attribute","simpleType","complexType","attributeGroup", and"group".list_abstract=>BOOLEANβ Show abstract elements, or skip them (because they cannot be instantiated anyway).
π 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 that's the whole thing bestie! This page was from perl v5.40.0, dated 2024-10-27, and the manual name is XML::C...stance(3pm). Stay slay. π
β¨
π¦ 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