Class: XML::DOM::EntityReference
- Defined in:
- lib/xml/dom/core.rb,
lib/xml/dom2/entityreference.rb
Overview
Class XML::DOM::EntityReference
superclass
Node
Constant Summary
Constants inherited from Node
Node::ATTRIBUTE_NODE, Node::CDATA_SECTION_NODE, Node::COMMENT_NODE, Node::DOCUMENT_FRAGMENT_NODE, Node::DOCUMENT_NODE, Node::DOCUMENT_TYPE_NODE, Node::ELEMENT_NODE, Node::ENTITY_NODE, Node::ENTITY_REFERENCE_NODE, Node::NODE_NODE, Node::NOTATION_NODE, Node::PROCESSING_INSTRUCTION_NODE, Node::TEXT_NODE
Instance Method Summary collapse
- #_checkNode(node) ⇒ Object
-
#cloneNode(deep = true) ⇒ Object
[DOM].
-
#dump(depth = 0) ⇒ Object
— EntityReference#dump(depth = 0).
-
#initialize(name, *children) ⇒ EntityReference
constructor
Class Methods.
-
#nodeName ⇒ Object
[DOM].
-
#nodeType ⇒ Object
[DOM].
-
#to_s ⇒ Object
reference form or expanded form?.
Methods inherited from Node
#+, #<=>, #==, #[], #[]=, #__collectAncestorNS, #__collectDescendatNS, #__sibling, #_ancestor, #_child, #_descendant, #_following, #_fsibling, #_getChildIndex, #_getMyLocation, #_getMyLocationInXPath, #_getNodeByAbsoluteLocationTerm, #_insertNodes, #_matchAttribute?, #_matchNode?, #_matchNodeAttributes?, #_matchNodeType?, #_nodesByLocationTerms, #_nodesByRelativeLocationTerm, #_preceding, #_psibling, #_removeFromTree, #_removeNode, #_searchID, #accept, #accept_name, #appendChild, #attributes, #childNodes, #childNodes=, #children_accept, #children_accept_name, #each, #firstChild, #getDigest, #getNodesByXPath, #getNodesByXPointer, #hasAttributes, #hasChildNodes, #insertBefore, #inspect, #isSupported, #lastChild, #localname, #makeXPath, #makeXPointer, #namespaceURI, #nextSibling, #nodeValue, #nodeValue=, #ownerDocument, #ownerDocument=, #parentNode, #parentNode=, #prefix, #prefix=, #previousSibling, #removeChild, #replaceChild, #trim
Constructor Details
#initialize(name, *children) ⇒ EntityReference
3029 3030 3031 3032 3033 |
# File 'lib/xml/dom/core.rb', line 3029 def initialize(name, *children) super(*children) raise "parameter error" if !name @name = name.freeze end |
Instance Method Details
#_checkNode(node) ⇒ Object
3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 |
# File 'lib/xml/dom/core.rb', line 3095 def _checkNode(node) unless node.nodeType == ELEMENT_NODE || node.nodeType == PROCESSING_INSTRUCTION_NODE || node.nodeType == COMMENT_NODE || node.nodeType == TEXT_NODE || node.nodeType == CDATA_SECTION_NODE || node.nodeType == ENTITY_REFERENCE_NODE raise DOMException.new(DOMException::HIERARCHY_REQUEST_ERR) end end |
#cloneNode(deep = true) ⇒ Object
- DOM
3091 3092 3093 |
# File 'lib/xml/dom/core.rb', line 3091 def cloneNode(deep = true) super(deep, @name) end |
#dump(depth = 0) ⇒ Object
— EntityReference#dump(depth = 0)
dumps the EntityReference.
3074 3075 3076 3077 3078 3079 3080 3081 3082 |
# File 'lib/xml/dom/core.rb', line 3074 def dump(depth = 0) print ' ' * depth * 2 print "&#{@name}{\n" @children.each do |child| child.dump(depth + 1) end if @children print ' ' * depth * 2 print "}\n" end |
#nodeName ⇒ Object
- DOM
3055 3056 3057 |
# File 'lib/xml/dom/core.rb', line 3055 def nodeName @name end |
#nodeType ⇒ Object
- DOM
3044 3045 3046 |
# File 'lib/xml/dom/core.rb', line 3044 def nodeType ENTITY_REFERENCE_NODE end |
#to_s ⇒ Object
reference form or expanded form?
3065 3066 3067 |
# File 'lib/xml/dom/core.rb', line 3065 def to_s "&#{@name};" end |