# File lib/xml/dom/core.rb, line 1518 def initialize(*children) super(*children) end
# File lib/xml/dom/core.rb, line 1728 def _checkNode(node) unless node.nodeType == ELEMENT_NODE || node.nodeType == PROCESSING_INSTRUCTION_NODE || node.nodeType == COMMENT_NODE || node.nodeType == DOCUMENT_TYPE_NODE raise DOMException.new(DOMException::HIERARCHY_REQUEST_ERR) end if node.nodeType == ELEMENT_NODE @children.each do |n| if n.nodeType == ELEMENT_NODE raise DOMException.new(DOMException::HIERARCHY_REQUEST_ERR) end end end if node.nodeType == DOCUMENT_TYPE_NODE @children.each do |n| if n.nodeType == DOCUMENT_TYPE_NODE raise DOMException.new(DOMException::HIERARCHY_REQUEST_ERR) end end end end
get the ID list
# File lib/xml/dom/core.rb, line 1712 def _getIDAttrs return {'*'=>'id'} if @idattrs.nil? @idattrs end
# File lib/xml/dom2/document.rb, line 311 def _getNamespaces(parentNamespaces = {}, all = false) { nil => nil } end
set the ID list by the attribute name with the element name (or wildcard)
# File lib/xml/dom/core.rb, line 1705 def _setIDAttr(attrname, elemname = '*') @idattrs = {} if @idattrs.nil? @idattrs[elemname] = attrname end
# File lib/xml/dom/core.rb, line 1670 def createAttribute(name) ret = Attr.new(name) ret.ownerDocument = self ret end
# File lib/xml/dom2/document.rb, line 258 def createAttributeNS(nsuri, qname) nsuri = XMLNSNS if qname == 'xmlns' or qname =~ /^xmlns:/ ret = Attr.new([nsuri, qname]) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1631 def createCDATASection(data) ret = CDATASection.new(data) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1644 def createComment(data) ret = Comment.new(data) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1696 def createDocumentFragment ret = DocumentFragment.new ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1605 def createElement(tagName) ret = Element.new(tagName) ret.ownerDocument = self ret end
# File lib/xml/dom2/document.rb, line 250 def createElementNS(nsuri, qname) ret = Element.new([nsuri, qname]) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1683 def createEntityReference(name) ret = EntityReference.new(name) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1657 def createProcessingInstruction(target, data) ret = ProcessingInstruction.new(target, data) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1618 def createTextNode(data) ret = Text.new(data) ret.ownerDocument = self ret end
# File lib/xml/dom/core.rb, line 1569 def doctype @children.each do |child| if child.nodeType == DOCUMENT_TYPE_NODE return child end end if @children nil end
# File lib/xml/dom/core.rb, line 1553 def documentElement @children.each do |child| if child.nodeType == ELEMENT_NODE return child end end if @children nil end
# File lib/xml/dom2/document.rb, line 281 def getElementById(elementId) ## [NOT IMPLEMENTED] raise "not implemented" end
# File lib/xml/dom/core.rb, line 1585 def getElementsByTagName(tagname) ret = NodeList.new @children.each do |node| if node.nodeType == ELEMENT_NODE if tagname == '*' || node.nodeName == tagname ret << node end ret << node.getElementsByTagName(tagname) end end if @children ret end
# File lib/xml/dom2/document.rb, line 266 def getElementsByTagNameNS(nsuri, localname) ret = NodeList.new @children.each do |node| if node.nodeType == ELEMENT_NODE if (localname == '*' || node.localname == localname) and (nsuri == '*' || node.namespaceURI == nsuri) ret << node end ret << node.getElementsByTagNameNS(nsuri, localname) end end if @children ret end
# File lib/xml/dom/core.rb, line 1718 def implementation return @implemantation if @implemantation ## singleton @implemantation = DOMImplementation.instance end
# File lib/xml/dom/core.rb, line 1724 def implementation=(impl) @implemantation = impl end
# File lib/xml/dom2/document.rb, line 238 def importNode(impnode, deep) ## [NOT IMPLEMENTED] raise "not implemented" end
# File lib/xml/dom/core.rb, line 1542 def nodeName "#document" end
# File lib/xml/dom/core.rb, line 1531 def nodeType DOCUMENT_NODE end