Nokogiri::XML

module Nokogiri::XML

Nokogiri::XML

Constants

XML_C14N_1_0

Original C14N 1.0 spec canonicalization

XML_C14N_1_1

C14N 1.1 spec canonicalization

XML_C14N_EXCLUSIVE_1_0

Exclusive C14N 1.0 spec canonicalization

Public Class Methods

Reader(string_or_io, url = nil, encoding = nil, options = ParseOptions::STRICT) { |options| ... } Show source

Parse an XML document using the Nokogiri::XML::Reader API. See Nokogiri::XML::Reader for mor information

# File lib/nokogiri/xml.rb, line 49
def Reader string_or_io, url = nil, encoding = nil, options = ParseOptions::STRICT

  options = Nokogiri::XML::ParseOptions.new(options) if Integer === options
  # Give the options to the user
  yield options if block_given?

  if string_or_io.respond_to? :read
    return Reader.from_io(string_or_io, url, encoding, options.to_i)
  end
  Reader.from_memory(string_or_io, url, encoding, options.to_i)
end
RelaxNG(string_or_io) Show source

Create a new Nokogiri::XML::RelaxNG document from string_or_io. See Nokogiri::XML::RelaxNG for an example.

# File lib/nokogiri/xml/relax_ng.rb, line 7
def RelaxNG string_or_io
  RelaxNG.new(string_or_io)
end
Schema(string_or_io) Show source

Create a new Nokogiri::XML::Schema object using a string_or_io object.

# File lib/nokogiri/xml/schema.rb, line 7
def Schema string_or_io
  Schema.new(string_or_io)
end
fragment(string) Show source

Parse a fragment from string in to a NodeSet.

# File lib/nokogiri/xml.rb, line 69
def fragment string
  XML::DocumentFragment.parse(string)
end
parse(thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block) Show source

Parse XML- Convenience method for Nokogiri::XML::Document.parse

# File lib/nokogiri/xml.rb, line 63
def parse thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block
  Document.parse(thing, url, encoding, options, &block)
end

© 2008–2016 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo
Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid
Licensed under the MIT License.

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部