module JSON::LD::API::REXML
REXML
implementation of an XML parser.
Public Class Methods
library()
click to toggle source
Returns the name of the underlying XML library.
@return [Symbol]
# File lib/json/ld/html/rexml.rb, line 17 def self.library :rexml end
Public Instance Methods
initialize_html_rexml(input, _options = {})
click to toggle source
Initializes the underlying XML library.
@param [Hash{Symbol => Object}] options @return [NodeProxy] of document root
# File lib/json/ld/html/rexml.rb, line 175 def initialize_html_rexml(input, _options = {}) require 'rexml/document' unless defined?(::REXML) doc = case input when ::REXML::Document input else # Only parse as XML, no HTML mode ::REXML::Document.new(input.respond_to?(:read) ? input.read : input.to_s) end NodeProxy.new(doc.root) if doc&.root end
Also aliased as: initialize_html