Class: ROXML::XML::Node
- Inherits:
-
Object
- Object
- ROXML::XML::Node
- Includes:
- NamespacedSearch, NodeExtensions
- Defined in:
- lib/roxml/xml.rb,
lib/roxml/xml/parsers/libxml.rb,
lib/roxml/xml/parsers/nokogiri.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from NodeExtensions
Methods included from NamespacedSearch
Class Method Details
.from(data) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/roxml/xml.rb', line 19 def self.from(data) case data when XML::Node data when XML::Document data.root when File, IO XML.parse_io(data).root else if (defined?(URI) && data.is_a?(URI::Generic)) || (defined?(Pathname) && data.is_a?(Pathname)) XML.parse_file(data.to_s).root else XML.parse_string(data).root end end end |
Instance Method Details
#default_namespace ⇒ Object
80 81 82 |
# File 'lib/roxml/xml/parsers/libxml.rb', line 80 def default_namespace doc.default_namespace end |