Class: Makiri::ProcessingInstruction
- Defined in:
- lib/makiri/processing_instruction.rb,
ext/makiri/makiri.c
Overview
An XML/HTML processing-instruction node. Rare in HTML5 (the parser usually treats “<?…>” as a bogus comment), present mainly for completeness.
Direct Known Subclasses
Class Method Summary collapse
-
.new(document, target, content) ⇒ Makiri::ProcessingInstruction
Create a detached processing instruction owned by
document(Nokogiri-style, document first).
Instance Method Summary collapse
-
#target ⇒ Object
DOM ‘ProcessingInstruction#target` — the PI’s target name.
Methods inherited from Node
#add_class, #append_class, #at, #attribute, #attribute?, #attributes, #blank?, #cdata?, #classes, #clone, #comment?, #document?, #document_fragment?, #dup, #each, #element?, #inspect, #path, #processing_instruction?, #remove_class, #root, #search, #set_attribute, #text?, #to_h, #traverse
Class Method Details
.new(document, target, content) ⇒ Makiri::ProcessingInstruction
Create a detached processing instruction owned by document (Nokogiri-style, document first). Delegates to Document#create_processing_instruction.
14 15 16 |
# File 'lib/makiri/processing_instruction.rb', line 14 def self.new(document, target, content) Makiri::Document.coerce!(document).create_processing_instruction(target, content) end |
Instance Method Details
#target ⇒ Object
DOM ‘ProcessingInstruction#target` — the PI’s target name. Defined once on the shared base so both backends expose it: the XML node reaches it here (its target IS its node name), while the HTML node overrides it with a native implementation earlier in the ancestor chain.
22 23 24 |
# File 'lib/makiri/processing_instruction.rb', line 22 def target name end |