Class: Moxml::Doctype
Overview
Doctype accessor methods are not fully implemented across all adapters. The availability of #name, #external_id, and #system_id depends on whether the specific adapter implements the corresponding adapter methods:
-
adapter.doctype_name(native)
-
adapter.doctype_external_id(native)
-
adapter.doctype_system_id(native)
Most adapters do not currently implement these methods. If you need DOCTYPE information, consider using adapter-specific methods or parsing the serialized XML manually.
Represents an XML DOCTYPE declaration
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#external_id ⇒ String?
Returns the DOCTYPE external ID.
-
#identifier ⇒ nil
Returns the primary identifier for this doctype Since DOCTYPE information is not reliably available across adapters, this returns nil.
-
#name ⇒ String?
Returns the DOCTYPE name (root element name).
-
#system_id ⇒ String?
Returns the DOCTYPE system ID.
Methods inherited from Node
#==, #[], #add_child, #add_next_sibling, #add_previous_sibling, #at_xpath, #children, #clone, #document, #each_node, #find, #find_all, #first_child, #has_children?, #initialize, #last_child, #namespace, #namespaces, #next_sibling, #parent, #previous_sibling, #remove, #replace, #text, #to_xml, wrap, #xpath
Methods included from XmlUtils
#encode_entities, #normalize_xml_value, #validate_comment_content, #validate_declaration_encoding, #validate_declaration_standalone, #validate_declaration_version, #validate_element_name, #validate_pi_target, #validate_prefix, #validate_uri
Constructor Details
This class inherits a constructor from Moxml::Node
Instance Method Details
#external_id ⇒ String?
Returns the DOCTYPE external ID
29 30 31 |
# File 'lib/moxml/doctype.rb', line 29 def external_id adapter.doctype_external_id(@native) end |
#identifier ⇒ nil
Returns the primary identifier for this doctype Since DOCTYPE information is not reliably available across adapters, this returns nil.
46 47 48 |
# File 'lib/moxml/doctype.rb', line 46 def identifier name end |
#name ⇒ String?
Returns the DOCTYPE name (root element name)
21 22 23 |
# File 'lib/moxml/doctype.rb', line 21 def name adapter.doctype_name(@native) end |
#system_id ⇒ String?
Returns the DOCTYPE system ID
37 38 39 |
# File 'lib/moxml/doctype.rb', line 37 def system_id adapter.doctype_system_id(@native) end |