123456789_123456789_123456789_123456789_123456789_

Module: Nokogiri::XML

Relationships & Source Files
Namespace Children
Modules:
Classes:
Exceptions:
Defined in: ext/nokogiri/nokogiri.c,
lib/nokogiri/xml.rb,
lib/nokogiri/xml/attr.rb,
lib/nokogiri/xml/attribute_decl.rb,
lib/nokogiri/xml/builder.rb,
lib/nokogiri/xml/cdata.rb,
lib/nokogiri/xml/character_data.rb,
lib/nokogiri/xml/document.rb,
lib/nokogiri/xml/document_fragment.rb,
lib/nokogiri/xml/dtd.rb,
lib/nokogiri/xml/element_content.rb,
lib/nokogiri/xml/element_decl.rb,
lib/nokogiri/xml/entity_decl.rb,
lib/nokogiri/xml/entity_reference.rb,
lib/nokogiri/xml/namespace.rb,
lib/nokogiri/xml/node.rb,
lib/nokogiri/xml/node_set.rb,
lib/nokogiri/xml/notation.rb,
lib/nokogiri/xml/parse_options.rb,
lib/nokogiri/xml/processing_instruction.rb,
lib/nokogiri/xml/reader.rb,
lib/nokogiri/xml/relax_ng.rb,
lib/nokogiri/xml/sax.rb,
lib/nokogiri/xml/schema.rb,
lib/nokogiri/xml/searchable.rb,
lib/nokogiri/xml/syntax_error.rb,
lib/nokogiri/xml/text.rb,
lib/nokogiri/xml/xpath.rb,
lib/nokogiri/xml/xpath_context.rb,
lib/nokogiri/xml/node/save_options.rb,
lib/nokogiri/xml/pp/character_data.rb,
lib/nokogiri/xml/pp/node.rb,
lib/nokogiri/xml/sax/document.rb,
lib/nokogiri/xml/sax/parser.rb,
lib/nokogiri/xml/sax/parser_context.rb,
lib/nokogiri/xml/sax/push_parser.rb,
lib/nokogiri/xml/xpath/syntax_error.rb

Constant Summary

Class Method Summary

Class Method Details

.fragment(string, options = ParseOptions::DEFAULT_XML, &block)

Parse a fragment from string in to a XML::NodeSet.

[ GitHub ]

  
# File 'lib/nokogiri/xml.rb', line 42

def fragment(string, options = ParseOptions::DEFAULT_XML, &block)
  XML::DocumentFragment.parse(string, options, &block)
end

.parse(thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block)

Parse XML. Convenience method for Document.parse

[ GitHub ]

  
# File 'lib/nokogiri/xml.rb', line 36

def parse(thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block)
  Document.parse(thing, url, encoding, options, &block)
end

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

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

Yields:

  • (options)
[ GitHub ]

  
# File 'lib/nokogiri/xml.rb', line 23

def Reader(string_or_io, url = nil, encoding = nil, options = ParseOptions::STRICT)
  options = Nokogiri::XML::ParseOptions.new(options) if Integer === options
  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(input) → Nokogiri::XML::RelaxNG) RelaxNg(input, parse_options) → Nokogiri::XML::RelaxNG)

Parse a RELAX NG schema definition and create a new XML::Schema object. This is a convenience method for RelaxNG.new

See related: RelaxNG.new

Parameters
  • input (String, IO) RELAX NG schema definition

  • parse_options (Nokogiri::XML::ParseOptions) Defaults to ParseOptions::DEFAULT_SCHEMA

Returns

XML::RelaxNG

[ GitHub ]

  
# File 'lib/nokogiri/xml/relax_ng.rb', line 22

def RelaxNG(input, parse_options = ParseOptions::DEFAULT_SCHEMA)
  RelaxNG.new(input, parse_options)
end

Schema(input) → Nokogiri::XML::Schema) Schema(input, parse_options) → Nokogiri::XML::Schema)

Parse an ::XSD schema definition and create a new Schema object. This is a convenience method for Schema.new

See related: Schema.new

Parameters
  • input (String, IO) ::XSD schema definition

  • parse_options (Nokogiri::XML::ParseOptions)

Returns

XML::Schema

[ GitHub ]

  
# File 'lib/nokogiri/xml/schema.rb', line 20

def Schema(input, parse_options = ParseOptions::DEFAULT_SCHEMA)
  Schema.new(input, parse_options)
end