Class: VCDOM::MiniDOM::Node
- Inherits:
-
Object
- Object
- VCDOM::MiniDOM::Node
- Defined in:
- lib/vcdom/minidom/node.rb
Direct Known Subclasses
Constant Summary collapse
- ELEMENT_NODE =
1- ATTRIBUTE_NODE =
2- TEXT_NODE =
3- CDATA_SECTION_NODE =
4- ENTITY_REFERENCE_NODE =
5- ENTITY_NODE =
6- PROCESSING_INSTRUCTION_NODE =
7- COMMENT_NODE =
8- DOCUMENT_NODE =
9- DOCUMENT_TYPE_NODE =
10- DOCUMENT_FRAGMENT_NODE =
11- NOTATION_NODE =
12- @@empty_child_nodes =
NodeList.new( [] )
Instance Method Summary collapse
- #append_child(new_child) ⇒ Object
-
#attributes ⇒ Object
Element でオーバーライド.
-
#child_nodes ⇒ Object
ModParentNode でオーバーライド.
- #first_child ⇒ Object
- #has_attributes ⇒ Object
- #has_child_nodes ⇒ Object
-
#initialize(owner_document) ⇒ Node
constructor
A new instance of Node.
- #insert_before(new_child, ref_child) ⇒ Object
- #last_child ⇒ Object
- #local_name ⇒ Object
-
#namespace_uri ⇒ Object
ElementNS, AttrNS でオーバーライド.
- #next_sibling ⇒ Object
-
#node_value ⇒ Object
nodeValue of type DOMString The value of this node, depending on its type; see the table above.
- #node_value=(value) ⇒ Object
-
#owner_document ⇒ Object
ownerDocument of type Document, readonly, modified in DOM Level 2 The Document object associated with this node.
-
#parent_node ⇒ Object
ModChildNode でオーバーライド.
- #prefix ⇒ Object
- #prefix=(value) ⇒ Object
- #previous_sibling ⇒ Object
- #remove_child(old_child) ⇒ Object
- #replace_child(new_child, old_child) ⇒ Object
-
#text_content ⇒ Object
textContent of type DOMString, introduced in DOM Level 3 This attribute returns the text content of this node and its descendants.
- #text_content=(value) ⇒ Object
Constructor Details
#initialize(owner_document) ⇒ Node
Returns a new instance of Node.
156 157 158 |
# File 'lib/vcdom/minidom/node.rb', line 156 def initialize( owner_document ) @owner_document = owner_document end |
Instance Method Details
#append_child(new_child) ⇒ Object
119 120 121 122 123 |
# File 'lib/vcdom/minidom/node.rb', line 119 def append_child( new_child ) # 常に HIERARCHY_REQUEST_ERR raise DOMException.new( DOMException::HIERARCHY_REQUEST_ERR, 'This node can\'t have a child node.' ) end |
#attributes ⇒ Object
Element でオーバーライド
141 |
# File 'lib/vcdom/minidom/node.rb', line 141 def attributes; return nil end |
#child_nodes ⇒ Object
ModParentNode でオーバーライド
115 |
# File 'lib/vcdom/minidom/node.rb', line 115 def child_nodes; return @@empty_child_nodes end |
#first_child ⇒ Object
116 |
# File 'lib/vcdom/minidom/node.rb', line 116 def first_child; return nil end |
#has_attributes ⇒ Object
142 |
# File 'lib/vcdom/minidom/node.rb', line 142 def has_attributes(); return false end |
#has_child_nodes ⇒ Object
118 |
# File 'lib/vcdom/minidom/node.rb', line 118 def has_child_nodes(); return false end |
#insert_before(new_child, ref_child) ⇒ Object
124 125 126 127 128 |
# File 'lib/vcdom/minidom/node.rb', line 124 def insert_before( new_child, ref_child ) # 常に HIERARCHY_REQUEST_ERR raise DOMException.new( DOMException::HIERARCHY_REQUEST_ERR, 'This node can\'t have a child node.' ) end |
#last_child ⇒ Object
117 |
# File 'lib/vcdom/minidom/node.rb', line 117 def last_child; return nil end |
#local_name ⇒ Object
146 |
# File 'lib/vcdom/minidom/node.rb', line 146 def local_name; return nil end |
#namespace_uri ⇒ Object
ElementNS, AttrNS でオーバーライド
145 |
# File 'lib/vcdom/minidom/node.rb', line 145 def namespace_uri; return nil end |
#next_sibling ⇒ Object
112 |
# File 'lib/vcdom/minidom/node.rb', line 112 def next_sibling; return nil end |
#node_value ⇒ Object
nodeValue of type DOMString
The value of this node, depending on its type; see the table above.
When it is defined to be null, setting it has no effect, including if the node is read-only.
Interface nodeValue
------------------------------------------------------------------------------------------------
Attr same as Attr.value
CDATASection same as CharacterData.data, the content of the CDATA Section
Comment same as CharacterData.data, the content of the comment
Document null
DocumentFragment null
DocumentType null
Element null
Entity null
EntityReference null
Notation null
ProcessingInstruction same as ProcessingInstruction.data
Text same as CharacterData.data, the content of the text node
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly and
if it is not defined to be null.
Exceptions on retrieval
DOMException
DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a DOMString variable on the implementation platform.
Attr, PI, CharacterData ( = CDATASection, Comment, Text ) でオーバーロード
58 |
# File 'lib/vcdom/minidom/node.rb', line 58 def node_value; return nil end |
#node_value=(value) ⇒ Object
59 |
# File 'lib/vcdom/minidom/node.rb', line 59 def node_value=( value ); end |
#owner_document ⇒ Object
ownerDocument of type Document, readonly, modified in DOM Level 2
The Document object associated with this node.
This is also the Document object used to create new nodes.
When this node is a Document or a DocumentType which is not used with any Document yet, this is null.
154 |
# File 'lib/vcdom/minidom/node.rb', line 154 def owner_document; return @owner_document end |
#parent_node ⇒ Object
ModChildNode でオーバーライド
110 |
# File 'lib/vcdom/minidom/node.rb', line 110 def parent_node; return nil end |
#prefix ⇒ Object
147 |
# File 'lib/vcdom/minidom/node.rb', line 147 def prefix; return nil end |
#prefix=(value) ⇒ Object
148 |
# File 'lib/vcdom/minidom/node.rb', line 148 def prefix=( value ); end |
#previous_sibling ⇒ Object
111 |
# File 'lib/vcdom/minidom/node.rb', line 111 def previous_sibling; return nil end |
#remove_child(old_child) ⇒ Object
129 130 131 132 133 |
# File 'lib/vcdom/minidom/node.rb', line 129 def remove_child( old_child ) # 常に NOT_FOUND_ERR raise DOMException.new( DOMException::NOT_FOUND_ERR, 'This node can\'t have a child node.' ) end |
#replace_child(new_child, old_child) ⇒ Object
134 135 136 137 138 |
# File 'lib/vcdom/minidom/node.rb', line 134 def replace_child( new_child, old_child ) # 常に NOT_FOUND_ERR raise DOMException.new( DOMException::NOT_FOUND_ERR, 'This node can\'t have a child node.' ) end |
#text_content ⇒ Object
textContent of type DOMString, introduced in DOM Level 3
This attribute returns the text content of this node and its descendants.
When it is defined to be null, setting it has no effect.
On setting, any possible children this node may have are removed and,
if it the new string is not empty or null, replaced by a single Text node
containing the string this attribute is set to.
On getting, no serialization is performed, the returned string does not
contain any markup. No whitespace normalization is performed and the
returned string does not contain the white spaces in element content
(see the attribute Text.isElementContentWhitespace).
Similarly, on setting, no parsing is performed either, the input string
is taken as pure textual content.
The string returned is made of the text content of this node depending on
its type, as defined below:
Node type Content
---------------------------------------------------
ELEMENT_NODE, ATTRIBUTE_NODE, concatenation of the textContent attribute value
ENTITY_NODE, of every child node, excluding COMMENT_NODE and
ENTITY_REFERENCE_NODE, PROCESSING_INSTRUCTION_NODE nodes. This is the
DOCUMENT_FRAGMENT_NODE empty string if the node has no children.
TEXT_NODE, CDATA_SECTION_NODE, nodeValue
COMMENT_NODE,
PROCESSING_INSTRUCTION_NODE
DOCUMENT_NODE, null ( = nodeValue )
DOCUMENT_TYPE_NODE,
NOTATION_NODE
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
Exceptions on retrieval
DOMException
DOMSTRING_SIZE_ERR: Raised when it would return more characters
than fit in a DOMString variable on the implementation platform.
ModParentNode ( = Element, Attr, Entity, EntityReference, DocumentFragment ) Document でオーバーライド
102 103 104 |
# File 'lib/vcdom/minidom/node.rb', line 102 def text_content return self.node_value end |
#text_content=(value) ⇒ Object
105 106 107 |
# File 'lib/vcdom/minidom/node.rb', line 105 def text_content=( value ) self.node_value = value end |