AttrDecl

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

class LibXML::Dtd::AttrDecl

LibXML DtD Element attribute declaration introspection (experimental)

Example

use LibXML::Document;
use LibXML::Dtd;
use LibXML::Dtd::AttrDecl;
use LibXML::Dtd::ElementDecl;
my LibXML::Document $doc .= parse: :file<example/dtd.xml>;
my LibXML::Dtd:D $dtd = $doc.getInternalSubset;
my LibXML::Dtd::AttrDecl $doc-foo:attr-decl = $dtd.attribute-declarations<doc><foo>;
# Element that contains the attribute declaration
my LibXML::Dtd::ElementDecl $doc:elem-decl =  $doc-foo:attr-decl.getElementDecl;
say xmlAttributeType($foo.attrType);
say xmlAttributeDefault($foo.defaultMode);
say $foo.elemName;
say $foo.defaultValue;

Methods

AttrType

Returns the attribute, type. One of: XML_ATTRIBUTE_CDATA, XML_ATTRIBUTE_ID, XML_ATTRIBUTE_IDREF, XML_ATTRIBUTE_IDREFS, XML_ATTRIBUTE_ENTITY, XML_ATTRIBUTE_ENTITIES, XML_ATTRIBUTE_NMTOKEN, XML_ATTRIBUTE_NMTOKENS, XML_ATTRIBUTE_ENUMERATION, or XML_ATTRIBUTE_NOTATION.

defaultMode

Returns the default mode, of of: XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED, or XML_ATTRIBUTE_FIXED.

defaultValue returns Str

Returns the default value, if any.

enum

method values returns Array
say $attr-decl.values; # [a b c]

Returns an array of possible values, or Array:U , if there is no enumerations.

This method is applicable to enumerated attributes (AttrType XML_ATTRIBUTE_ENUMERATION).

elemName

Returns the name of the element holding the attribute.

getElementDecl

method getElementDecl() returns LibXML::Dtd::ElementDecl

Returns the element declaration associated with this attribute.

prefix

Returns the namespace prefix, if any.

LibXML v0.6.12

Raku bindings to the libxml2 native library

Authors

  • David Warring

License

Artistic-2.0

Dependencies

File::TempMethod::AlsoW3C::DOM:ver<0.0.2+>XML

Test Dependencies

Provides

  • LibXML
  • LibXML::Attr
  • LibXML::Attr::Map
  • LibXML::CDATA
  • LibXML::Comment
  • LibXML::Config
  • LibXML::Dict
  • LibXML::Document
  • LibXML::DocumentFragment
  • LibXML::Dtd
  • LibXML::Dtd::AttrDecl
  • LibXML::Dtd::ElementContent
  • LibXML::Dtd::ElementDecl
  • LibXML::Dtd::Entity
  • LibXML::Dtd::Notation
  • LibXML::Element
  • LibXML::EntityRef
  • LibXML::Enums
  • LibXML::ErrorHandling
  • LibXML::HashMap
  • LibXML::HashMap::Maker
  • LibXML::InputCallback
  • LibXML::Item
  • LibXML::Namespace
  • LibXML::Node
  • LibXML::Node::List
  • LibXML::Node::Set
  • LibXML::PI
  • LibXML::Parser
  • LibXML::Parser::Context
  • LibXML::Pattern
  • LibXML::PushParser
  • LibXML::Raw
  • LibXML::Raw::DOM::Attr
  • LibXML::Raw::DOM::Document
  • LibXML::Raw::DOM::Element
  • LibXML::Raw::DOM::Node
  • LibXML::Raw::Defs
  • LibXML::Raw::Dict
  • LibXML::Raw::HashTable
  • LibXML::Raw::RelaxNG
  • LibXML::Raw::Schema
  • LibXML::Raw::TextReader
  • LibXML::Reader
  • LibXML::RegExp
  • LibXML::RelaxNG
  • LibXML::SAX
  • LibXML::SAX::Builder
  • LibXML::SAX::Handler
  • LibXML::SAX::Handler::SAX2
  • LibXML::SAX::Handler::SAX2::Locator
  • LibXML::SAX::Handler::XML
  • LibXML::Schema
  • LibXML::Text
  • LibXML::Types
  • LibXML::XPath::Context
  • LibXML::XPath::Expression
  • LibXML::XPath::Object
  • LibXML::_CharacterData
  • LibXML::_DomNode
  • LibXML::_Options
  • LibXML::_ParentNode
  • LibXML::_Validator

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