GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ruby/rexml: REXML is an XML toolkit for Ruby

BranchesTags
Open more actions menu

Latest commit

 

History

772 Commits
772 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
benchmark
benchmark
 
 
doc/rexml
doc/rexml
 
 
lib
lib
 
 
tasks
tasks
 
 
test
test
 
 
.gitignore
.gitignore
 
 
Gemfile
Gemfile
 
 
LICENSE.txt
LICENSE.txt
 
 
NEWS.md
NEWS.md
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
rexml.gemspec
rexml.gemspec
 
 

Repository files navigation

REXML

REXML was inspired by the Electric XML library for Java, which features an easy-to-use API, small size, and speed. Hopefully, REXML, designed with the same philosophy, has these same features. I've tried to keep the API as intuitive as possible, and have followed the Ruby methodology for method naming and code flow, rather than mirroring the Java API.

REXML supports both tree and stream document parsing. Stream parsing is faster (about 1.5 times as fast). However, with stream parsing, you don't get access to features such as XPath.

API

See the API documentation.

Usage

We'll start with parsing an XML document

require "rexml/document"
file = File.new( "mydoc.xml" )
doc = REXML::Document.new file

Line 3 creates a new document and parses the supplied file. You can also do the following

require "rexml/document"
include REXML  # so that we don't have to prefix everything with REXML::...
string = <<EOF
  <mydoc>
    <someelement attribute="nanoo">Text, text, text</someelement>
  </mydoc>
EOF
doc = Document.new string

So parsing a string is just as easy as parsing a file.

Support

REXML support follows the same maintenance cycle as Ruby releases, as shown on https://www.ruby-lang.org/en/downloads/branches/.

If you are running on an end-of-life Ruby, do not expect modern REXML releases to be compatible with it; in fact, it's recommended that you DO NOT use this gem, and instead use the REXML version that came bundled with your end-of-life Ruby version.

The required_ruby_version on the gemspec is kept updated on a best-effort basis by the community. Up to version 3.2.5, this information was not set. That version is known broken with at least Ruby < 2.3.

Development

After checking out the repo, run rake test to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rexml.

License

The gem is available as open source under the terms of the BSD-2-Clause.

About

REXML is an XML toolkit for Ruby

Resources

Readme
BSD-2-Clause license

Security policy

Security policy
Activity
Custom properties

Stars

181 stars

Watchers

39 watching

Forks

105 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.