module FN::Document::ClassMethods

Public Instance Methods

file(file, options = {}) click to toggle source

Reads XML from a file, and returns the FN::Document

# File lib/fn/document.rb, line 27
def file(file, options = {})
  new(XML::Document.file(file), options)
end
migrate_from(xml) click to toggle source

Creates a new FN::Document from an XML object that is in the old- school (original) style

# File lib/fn/document.rb, line 17
def migrate_from(xml)
  raise_unless_xml_doc xml
  @xslt ||= XSLT::Stylesheet.new(
            XML::Document.file(
            File.dirname(__FILE__) + "/migrate.xslt"
          ))
  return FN::Document.new(@xslt.apply(xml))
end
string(string, options = {}) click to toggle source

Reads XML from a string, and returns the FN::Document

# File lib/fn/document.rb, line 32
def string(string, options = {})
  new(XML::Document.string(string), options)
end