class Nokogiri::XML::DocumentFragment
def initialize document, tags = nil, ctx = nil
subtree created, e.g., namespaces will be resolved relative
If +ctx+ is present, it is used as a context node for the
Create a new DocumentFragment from +tags+.
#
def initialize document, tags = nil, ctx = nil return self unless tags children = if ctx # Fix for issue#490 if Nokogiri.jruby? ctx.parse("<root>#{tags}</root>").xpath("/root/node()") else ctx.parse(tags) end else XML::Document.parse("<root>#{tags}</root>") \ .xpath("/root/node()") end children.each { |child| child.parent = self } end