Schema...leType(3pm)

πŸ“¦
version 1.10 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Schema...leType(3pm) ✨

okay bestie, this is the manual page for XML::Validator::Schema::SimpleType πŸ’– (the file itself goes by Schema...leType(3pm) in the terminal, the title bar just does that little truncation thing, she's shy 🫢). Perl doc, user contributed, the whole vibe. let's get into it.


🌸 NAME 🌸

XML::Validator::Schema::SimpleType β€” simple XML Schema types. that's it, that's the name, slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is the XML Schema simple type system, fr fr. this module hands you objects and class methods to support simple types, periodt ✨

but the way that complex types are literally a whole other thing β€” for those you gotta go see the ModelNode class instead. not here. different module. iykyk 🌈


πŸŽ€ USAGE πŸŽ€

here's the group chat recap of how you actually use her:

  # create a new anonymous type based on an existing type
  my $type = $string->derive();

  # create a new named type based on an existing type
  my $type = $string->derive(name => 'myString');

  # add a restriction
  $type->restrict(enumeration => "10");

  # check a value against a type
  ($ok, $msg) = $type->check($value);

let's break it down bestie:

  • my $type = $string->derive(); β€” makes a brand new anonymous type off an existing type. no name, just vibes πŸ‘‘
  • my $type = $string->derive(name => 'myString'); β€” same energy but now she has a name, iconic ✨
  • $type->restrict(enumeration => "10"); β€” slaps a restriction on there. in this case an enumeration of "10" πŸ“
  • ($ok, $msg) = $type->check($value); β€” the vibe check πŸ’€ runs $value against the type and hands you back $ok and $msg. that's the whole moment.

and that's the page bestie, no cap, every last detail preserved πŸ’–

this gem comes from the User Contributed Perl Documentation collection, built against perl v5.32.0, dated 2021-01-05 πŸ¦‹ go forth and validate, you main character πŸŒΈπŸ‘‘πŸ’…

πŸ“¦ where this page comes from