Document

NAME LibXML::Class::Document - document object

DESCRIPTION

The concept of LibXML::Class document is mostly covered in LibXML::Class::Manual.

Attributes

  • LibXML::Document $.libxml-document

    The instance of deserialized LibXML document.

  • LibXML::Class::Config:D $.config

    An instance of LibXML::Class configuration object. Defaults to the global singleton.

Methods

  • proto method parse(|)

    • multi method parse(::?CLASS:U: LibXML::Class::Config :$config, |args)

      This methods creates a new instance of LibXML::Class::Document using either the provided $config, or the global singleton. Then $config.libxml-config is used to get the class of LibXML document using class-from method and then call parse method on the class with arguments in args.

      At the end a new LibXML::Class document is created using the parsed LibXML document and the config object.

    • multi method parse(::?CLASS:D: |args)

      Create a new $.libxml-document by using $.config.libxml-config and calling method parse with arguments in args. Returns the invocator.

  • method add-deserialization(LibXML::Class::XML:D $deserialization)

    Unless disabled by the configuration, adds $deserialization to the document registry for fast hash-indexed search.

  • proto method has-deserialization(|)

    • multi method has-deserialization(LibXML::Element:D $element)

      Tells if there is an entry for the $element in the global registry.

    • multi method has-deserialization(Str:D $unique-key)

      Tells if there is an entry for the $unique-key in the global registry.

  • method deserializations(LibXML::Element:D $element)

    Returns all deserializations registered for the $element, or an empty list if there is none.

  • method remove-deserialization(LibXML::Class::XML:D $deserialization)

    Removes the $deserialization from the global registry.

  • proto method find-deserializations(|)

    • method find-deserializations(LibXML::Node:D $node)

    • method find-deserializations(Iterable:D $nodes)

    Returns a list of deserializations for a $node or multiple $nodes. When lazy operations are on and a node is not deserialized yet then the method tries to determine the path to the node and deserialize it, possibly deserializing all its parents along the way.

  • method findnodes(|args)

    This is a wrapper method which first calls $.libxml-document.findnodes(|args) and then sends all found nodes to the find-deserializations method.

    Returns a LibXML::Class::X::Deserialization::NoBacking Failure if there is no $.libxml-document meaning that the object is not a result of deserialization.

SEE ALSO

COPYRIGHT

(c) 2023, Vadim Belman [email protected]

LICENSE

Artistic License 2.0

See the 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.