XML::C...stance(3pm)

πŸ“¦
version 1.64 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

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 all complexType names.
  • $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 a HASH with the base-type as key and an ARRAY of types which extend it.
  • $obj->simpleTypes() β€” Returns a list with all simpleType names.
  • $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 a targetNamespace attribute. (Another lil typo, keeping it fr fr.)
  • $obj->type($uri) β€” Returns the type definition with the specified name.
  • $obj->types() β€” Returns a list of all simpleTypes and complexTypes.

πŸ”₯ 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 all schemaLocations specified with the import $ns (one of the values returned by imports()).
  • $obj->imports() β€” Returns a list with all namespaces which need to be imported.
  • $obj->includeLocations() β€” Returns a list of all schemaLocations which 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