class
XML::DOM::Parser
- XML::DOM::Parser
- XML::SAX::Handlers
- Reference
- Object
Defined in:
dom/parser.crConstructors
Instance Method Summary
- #base : String | Nil
- #base=(value : String | Nil)
-
#cdata_section(data : String) : Nil
Called for CDATA sections.
-
#character_data(data : String) : Nil
Called for text.
-
#comment(data : String) : Nil
Called for comments.
- #document : XMLDocument
-
#empty_element(name : String, attributes : Array(Tuple(String, String))) : Nil
Called for an empty element tag.
-
#end_doctype_decl : Nil
Called at the and of a DOCTYPE declaration.
-
#end_element(name : String) : Nil
Called at the end of an element tag.
- #entity_decl(entity : SAX::Entity) : Nil
-
#entity_reference(name : String) : Nil
Called when trying to expand an undeclared or invalid entity within character data.
-
#notation_decl(name : String, public_id : String | Nil, system_id : String | Nil) : Nil
Called for notation declarations in a DTD.
- #parse : Nil
-
#processing_instruction(target : String, data : String) : Nil
Called for processing instructions.
-
#start_doctype_decl(name : String, system_id : String | Nil, public_id : String | Nil, intsubset : Bool)
Called at the start of a DOCTYPE declaration.
-
#start_element(name : String, attributes : Array(Tuple(String, String))) : Nil
Called at the start of an element tag.
-
#xml_decl(version : String, encoding : String | Nil, standalone : Bool | Nil) : Nil
Called for XML declarations.
Instance methods inherited from class XML::SAX::Handlers
attlist_decl(element_name : String, name : String, type : Symbol, names : Array(String) | Nil, default : Symbol, value : String | Nil) : Nil
attlist_decl,
cdata_section(data : String) : Nil
cdata_section,
character_data(data : String) : Nil
character_data,
comment(data : String) : Nil
comment,
element_decl(name : String, content : ElementDecl) : Nil
element_decl,
empty_element(name : String, attributes : Array(Tuple(String, String))) : Nil
empty_element,
end_doctype_decl : Nil
end_doctype_decl,
end_element(name : String) : Nil
end_element,
entity_decl(entity : Entity) : Nil
entity_decl,
entity_reference(name : String)
entity_reference,
error(message : String, location : Location)
error,
notation_decl(name : String, public_id : String | Nil, system_id : String | Nil) : Nil
notation_decl,
open_external(base : String | Nil, uri : String, & : String, IO -> ) : Nilopen_external(base : String | Nil, uri : String) : Tuple(String, IO) | Nil open_external, processing_instruction(target : String, data : String) : Nil processing_instruction, start_doctype_decl(name : String, system_id : String | Nil, public_id : String | Nil, intsubset : Bool) start_doctype_decl, start_element(name : String, attributes : Array(Tuple(String, String))) : Nil start_element, text_decl(version : String, encoding : String | Nil) : Nil text_decl, xml_decl(version : String, encoding : String | Nil, standalone : Bool | Nil) : Nil xml_decl
Constructor Detail
Instance Method Detail
Called for CDATA sections.
- data is all the text inside the data section.
Called for text.
It might be called multiple times for a single contiguous text in a XML document (for example because we processed an entity). You might have to concatenate data when searching for some pattern in text, or to build a single text node in a DOM tree.
Called for comments.
- data is all the text inside the comment.
Called for an empty element tag.
See #start_element for details.
Unless overridden, calls #start_element then #end_element by default.
Called at the and of a DOCTYPE declaration.
Called at the end of an element tag.
Called when trying to expand an undeclared or invalid entity within character data.
Called for notation declarations in a DTD.
- name is the declared notation name.
- system_id and public_id will be nil when unspecified.
Called for processing instructions.
- target is the first word in the processing instruction.
- data is the rest of the instruction.
Called at the start of a DOCTYPE declaration.
- name is the root element name.
- system_id and public_id will be nil when unspecified.
- intsubset is true when the doctype has an internal subset declaration.
Called at the start of an element tag.
- name is the tag name.
- attributes is an array of attribute name/value tuples.
The attributes array presents the attributes in the order they have been parsed. If an attribute is present twice with the same name, there will be two entries in the array.
Called for XML declarations.
- version defaults to
"1.0". - encoding may be nil, in which case the parser assumes UTF-8 or the detected encoding.
- standalone will be nil when unspecified.