NS

NAME LibXML::Class::NS - base role for namespace-aware classes

DESCRIPTION

This role implements the most basic namespace functionality which includes:

  • default namespace value

  • default namespace prefix value

  • map of namespace prefixes into namespaces

Attributes

  • Str $.xml-default-ns

    The default namespace value, when set.

  • Str $.xml-default-ns-pfx

    The default namespace prefix, when set.

  • OHash:D $.xml-namespaces

    An ordered hash of namespace prefix values. OHash is an internal implementation provided by LibXML::Class::Types.

Methods

  • method xml-set-ns-from-defs($ns-defs, Bool:D :$override = True)

    This method sets up namespace information from declarations in $ns-defs, as described in LibXML::Class::Manual, where named argument :namespace (or :ns) is described.

  • method xml-guess-default-ns(LibXML::Node :$resolve)

    This method does the most basic job in trying to find out what namespace applies to the object. It is using only the information provided by the object itself. When guessing $.xml-default-ns is ignored if $.xml-default-ns-pfx is set. And if the prefix cannot be resolved using the local definitions in $.xml-namespaces then it tries to use the $resolve parameter, if provided.

    When no namespace can be found a Failure is returned wrapped around LibXML::Class::X::NS::Prefix exception.

SEE ALSO

COPYRIGHT

(c) 2023, Vadim Belman <[email protected]>

LICENSE

Artistic License 2.0

See the LICENSE|../../../../LICENSE file in this distribution.

LibXML::Class v0.0.1

General purpose XML de-/serialization for Raku

Authors

  • Vadim Belman

License

Artistic-2.0

Dependencies

LibXML:ver<0.10.0>:auth<zef:dwarring>AttrX::Mooish:auth<zef:vrurg>:api<1.0.0+>:ver<1.0.3+>Hash::Merge:ver<2.0.0>:auth<github:scriptkitties>:api<2>

Provides

  • LibXML::Class
  • LibXML::Class::Attr
  • LibXML::Class::Attr::Node
  • LibXML::Class::Attr::XMLish
  • LibXML::Class::CX
  • LibXML::Class::Config
  • LibXML::Class::Descriptor
  • LibXML::Class::Document
  • LibXML::Class::HOW::AttrContainer
  • LibXML::Class::HOW::Configurable
  • LibXML::Class::HOW::Element
  • LibXML::Class::HOW::ElementRole
  • LibXML::Class::HOW::ElementSeq
  • LibXML::Class::HOW::Explicit
  • LibXML::Class::HOW::Imply
  • LibXML::Class::HOW::Named
  • LibXML::Class::ItemDescriptor
  • LibXML::Class::NS
  • LibXML::Class::Node
  • LibXML::Class::Types
  • LibXML::Class::Utils
  • LibXML::Class::X
  • LibXML::Class::XML

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.