View on GitHub

LibXML-raku

Raku bindings to the libxml2 native library

[Raku LibXML Project] / [LibXML Module] / Dtd :: Entity

class LibXML::Dtd::Entity

DtD entity definitions

Example

use LibXML::Document;
use LibXML::Dtd::Entity;
use LibXML::Enums;

my $string = q:to<END>;
<!ENTITY foo "Fooo">
END

my LibXML::Dtd $dtd .= parse: :$string;
my LibXML::Dtd::Entity $ent = $dtd.entities<foo>;

note $ent.name; # foo
note $ent.value; # Fooo
say xmlEntityType($ent.entityType); # XML_INTERNAL_GENERAL_ENTITY
note $ent.Str; # <!ENTITY foo "Foo ">

method publicId

method publicId() returns Str

return the Public (External) ID

method systemId

method systemId() returns Str

Return the System ID

method name

method name() returns Str

Return the entity name

method notationName

method notationName() returns Mu

return the name of any notation associated with this entity

method notation

method notation() returns LibXML::Dtd::Notation

return any notation associated with this entity

method entityType

method entityType() returns Mu

return the entity type

One of: XML_EXTERNAL_GENERAL_PARSED_ENTITY, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY, XML_EXTERNAL_PARAMETER_ENTITY, XML_INTERNAL_GENERAL_ENTITY, XML_INTERNAL_PARAMETER_ENTITY, or XML_INTERNAL_PREDEFINED_ENTITY