Module: Moxml::Doctype
- Includes:
- Node
- Defined in:
- lib/moxml/doctype.rb
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 included from NodeBehavior
Constants included from XmlUtils
Instance Attribute Summary
Attributes included from NodeBehavior
#context, #native, #parent_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 included from Node
adapter, contract_module, contract_modules, node_type_map, wrap
Methods included from NodeBehavior
#==, #adapter, #add_child, #add_next_sibling, #add_previous_sibling, #after, #ancestors, #at_xpath, #before, #blank?, #children, #clear_native_memo!, #content, #descendants, #digest, #document, #dup, #each, #each_node, #entity_bearing?, #find, #find_all, #first_child, #following_siblings, #has_children?, #initialize, #invalidate_namespace_cache!, #last_child, #line_number, #materialize, #materialize_fields, #namespace, #namespaces, #next_sibling, #outer_xml, #parent, #path, #preceding_siblings, #previous_sibling, #prime_contract, #refresh_native!, #remove, #replace, #source_position, #text, #to_xml, #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_entity_reference_name, #validate_pi_target, #validate_prefix, #validate_uri
Instance Method Details
#external_id ⇒ String?
Returns the DOCTYPE external ID
31 32 33 |
# File 'lib/moxml/doctype.rb', line 31 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.
48 49 50 |
# File 'lib/moxml/doctype.rb', line 48 def identifier name end |
#name ⇒ String?
Returns the DOCTYPE name (root element name)
23 24 25 |
# File 'lib/moxml/doctype.rb', line 23 def name adapter.doctype_name(@native) end |
#system_id ⇒ String?
Returns the DOCTYPE system ID
39 40 41 |
# File 'lib/moxml/doctype.rb', line 39 def system_id adapter.doctype_system_id(@native) end |