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-documentThe instance of deserialized LibXML document.
LibXML::Class::Config:D $.configAn instance of
LibXML::Classconfiguration 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::Documentusing either the provided$config, or the global singleton. Then$config.libxml-configis used to get the class ofLibXMLdocument usingclass-frommethod and then callparsemethod on the class with arguments inargs.At the end a new
LibXML::Classdocument is created using the parsedLibXMLdocument and the config object.multi method parse(::?CLASS:D: |args)Create a new
$.libxml-documentby using$.config.libxml-configand calling methodparsewith arguments inargs. Returns the invocator.
method add-deserialization(LibXML::Class::XML:D $deserialization)Unless disabled by the configuration, adds
$deserializationto 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
$elementin the global registry.multi method has-deserialization(Str:D $unique-key)Tells if there is an entry for the
$unique-keyin 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
$deserializationfrom 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
$nodeor 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 thefind-deserializationsmethod.Returns a
LibXML::Class::X::Deserialization::NoBackingFailure if there is no$.libxml-documentmeaning 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.