lib/genit/xml_document.rb in genit-0.4.1 vs lib/genit/xml_document.rb in genit-0.5
- old
+ new
@@ -15,8 +15,18 @@
# Returns a Nokogiri::XML document.
def self.open file
Nokogiri::XML(File.open(file))
end
+ # Public: Open a fragment of xml document.
+ #
+ # file - Full path String filename.
+ #
+ # Returns a Nokogiri::XML document.
+ def self.open_fragment file
+ string = IO.read file
+ Nokogiri::XML.fragment string
+ end
+
end
end