Sha256: 4d56236864bdfc05c571592d6fe6c282fd889a757d9e63f04f571dc9dea554c9
Contents?: true
Size: 705 Bytes
Versions: 19
Compression:
Stored size: 705 Bytes
Contents
module Nokogiri module XML class DocumentFragment < Node def self.new(document, *rest) # :nodoc: node_ptr = LibXML.xmlNewDocFragment(document.cstruct) node_cstruct = LibXML::XmlNode.new(node_ptr) node_cstruct.keep_reference_from_document! node = Node.wrap(node_cstruct, self) if node.document.child && node.document.child.node_type == ELEMENT_NODE # TODO: node_type check should be ported into master, because of e.g. DTD nodes node.cstruct[:ns] = node.document.children.first.cstruct[:ns] end node.send :initialize, document, *rest yield node if block_given? node end end end end
Version data entries
19 entries across 19 versions & 2 rubygems