Skip to content

Commit 9b96c60

Browse files
committed
Move most readme content to the updated docs.
1 parent ea4ad29 commit 9b96c60

1 file changed

Lines changed: 9 additions & 106 deletions

File tree

README.md

Lines changed: 9 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,18 @@
44
The libxml gem provides Ruby language bindings for GNOME's Libxml2
55
XML toolkit. It is free software, released under the MIT License.
66

7-
We think libxml-ruby is the best XML library for Ruby because:
7+
libxml-ruby let's you:
88

9-
* Speed - It's much faster than REXML
10-
* Features - It provides an amazing number of features
11-
* Conformance - It passes all 1800+ tests from the OASIS XML Tests Suite
9+
* Read xml files
10+
* Write xml files
11+
* Search xml files using XPath
12+
* Validate XML files
1213

13-
## Requirements
14-
libxml-ruby requires Ruby 3.2 or higher. It depends on libxml2 to
15-
function properly. libxml2, in turn, depends on:
14+
Full documentation is available at [xml4r.github.io/libxml-ruby](https://xml4r.github.io/libxml-ruby/) including a getting started guide.
1615

17-
* libm (math routines: very standard)
18-
* libz (zlib)
19-
* libiconv
16+
## Requirements
2017

21-
If you are running Linux or Unix you'll need a C compiler so the
22-
extension can be compiled when it is installed. If you are running
23-
Windows, then install the x64-mingw-ucr gem or build it yourself using
24-
[Ruby for Windows](https://rubyinstaller.org/) or directly with
25-
[msys2](https://msys2.github.io/) and ucrt64.
18+
libxml-ruby requires Ruby 3.2 or higher.
2619

2720
## Installation
2821
The easiest way to install libxml-ruby is via RubyGems. To install:
@@ -50,89 +43,7 @@ bundle config build.libxml-ruby --with-xml2-config=/path/to/xml2-config
5043
bundle install libxml-ruby
5144
```
5245

53-
If you are running Windows, then install the libxml-ruby-x64-mingw32 gem.
54-
The gem includes prebuilt extensions for Ruby 3.2 and 3.3.
55-
56-
The gem also includes a Microsoft VC++ solution and XCode project - these
57-
are very useful for debugging.
58-
59-
libxml-ruby's source code lives on [GitHub](https://github.com/xml4r/libxml-ruby).
60-
61-
## Getting Started
62-
Using libxml is easy. First decide what parser you want to use:
63-
64-
* Generally you'll want to use the `LibXML::XML::Parser` which provides a tree based API.
65-
* For larger documents that don't fit into memory, or if you prefer an input based API, use the `LibXML::XML::Reader`.
66-
* To parse HTML files use `LibXML::XML::HTMLParser`.
67-
* If you are masochistic, then use the `LibXML::XML::SaxParser`, which provides a callback API.
68-
69-
Once you have chosen a parser, choose a datasource. Libxml can parse files, strings, URIs
70-
and IO streams. For each data source you can specify an `LibXML::XML::Encoding`, a base uri and
71-
various parser options. For more information, refer the `LibXML::XML::Parser.document`,
72-
`LibXML::XML::Parser.file`, `LibXML::XML::Parser.io` or `LibXML::XML::Parser.string` methods (the
73-
same methods are defined on all four parser classes).
74-
75-
## Advanced Functionality
76-
Beyond the basics of parsing and processing XML and HTML documents,
77-
libxml provides a wealth of additional functionality.
78-
79-
Most commonly, you'll want to use its `LibXML::XML::XPath` support, which makes
80-
it easy to find data inside an XML document. Although not as popular,
81-
`LibXML::XML::XPointer` provides another API for finding data inside an XML document.
82-
83-
Often times you'll need to validate data before processing it. For example,
84-
if you accept user generated content submitted over the Web, you'll
85-
want to verify that it does not contain malicious code such as embedded scripts.
86-
This can be done using libxml's powerful set of validators:
87-
88-
* DTDs (`LibXML::XML::Dtd`)
89-
* Relax Schemas (`LibXML::XML::RelaxNG`)
90-
* XML Schema (`LibXML::XML::Schema`)
91-
92-
Finally, if you'd like to use XSL Transformations to process data, then install
93-
the [libxslt gem](https://github.com/xml4r/libxslt-ruby).
94-
95-
## Usage
96-
For information about using libxml-ruby please refer to its
97-
[documentation](https://xml4r.github.io/libxml-ruby/).
98-
99-
All libxml classes are in the `LibXML::XML` module. The easiest
100-
way to use libxml is to `require 'xml'`. This will mixin
101-
the LibXML module into the global namespace, allowing you to
102-
write code like this:
103-
104-
```ruby
105-
require 'xml'
106-
document = XML::Document.new
107-
```
108-
109-
However, when creating an application or library you plan to
110-
redistribute, it is best to not add the LibXML module to the global
111-
namespace, in which case you can either write your code like this:
112-
113-
```ruby
114-
require 'libxml'
115-
document = LibXML::XML::Document.new
116-
```
117-
118-
Or you can utilize a namespace for your own work and include LibXML into it.
119-
For example:
120-
121-
```ruby
122-
require 'libxml'
123-
124-
module MyApplication
125-
include LibXML
126-
127-
class MyClass
128-
def some_method
129-
document = XML::Document.new
130-
end
131-
end
132-
end
133-
```
134-
135-
For simplicity's sake, the documentation uses the xml module in its examples.
46+
Full documentation is available at [xml4r.github.io/libxml-ruby](https://xml4r.github.io/libxml-ruby/) including a [getting started](https://xml4r.github.io/libxml-ruby/getting_started/) guide.
13647

13748
## Tests
13849

@@ -148,14 +59,6 @@ Once you have built the shared library, you can then run tests using rake:
14859
rake test
14960
```
15061

151-
[![Build Status](https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml/badge.svg)](https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml)
152-
153-
## Documentation
154-
Documentation is available at [xml4r.github.io/libxml-ruby](https://xml4r.github.io/libxml-ruby/).
155-
156-
API reference documentation is generated via rdoc and is available at
157-
[xml4r.github.io/libxml-ruby/reference](https://xml4r.github.io/libxml-ruby/reference/).
158-
15962
## Support
16063
If you have any questions about using libxml-ruby, please report an issue
16164
on [GitHub](https://github.com/xml4r/libxml-ruby/issues).

0 commit comments

Comments
 (0)