This class was contributed by Mikko Tiihonen mikko DOT tiihonen AT hut DOT fi
From rexml/encodings/ISO-8859-15.rb
This class was contributed by Mikko Tiihonen mikko DOT tiihonen AT hut DOT fi
From rexml/light/node.rb
[ :element, parent, name, attributes, children* ] a = Node.new a << "B" # => <a>B</a> a.b # => <a>B</a> a.b[1] # => <a>B<a> a.b[1]["x"] = "y" # => <a>B<b x="y"></a> a.b[0].c # => <a>B<c></c><b x="y"></a> a.b.c << "D" # => <a>B<c>D</c><b x="y"></b></a>
From rexml/rexml.rb
REXML is an XML toolkit for Ruby, in Ruby.
REXML is a pure Ruby, XML 1.0 conforming, non-validating toolkit with an intuitive API. REXML passes 100% of the non-validating Oasis tests, and provides tree, stream, SAX2, pull, and lightweight APIs. REXML also includes a full XPath 1.0 implementation. Since Ruby 1.8, REXML is included in the standard Ruby distribution.
| Main page: | www.germane-software.com/software/rexml |
| Author: | Sean Russell <seratgermanehyphensoftwaredotcom> |
| Version: | 3.1.7.1 |
| Date: | 2007/209 |
This API documentation can be downloaded from the REXML home page, or can be accessed online
A tutorial is available in the REXML distribution in docs/tutorial.html, or can be accessed online
From rexml/encoding.rb
-*- mode: ruby; ruby-indent-level: 2; indent-tabs-mode: t; tab-width: 2 -*- vim: sw=2 ts=2</seratgermanehyphensoftwaredotcom></a></b></b></a>
| Modules | |
|---|---|
| DTD | |
| Encoding | |
| EntityConst | This is a set of entity constants — the ones defined in the XML specification. These are gt, lt, amp, quot and apos. |
| Formatters | |
| Functions | If you add a method, keep in mind two things: (1) the first argument will always be a list of nodes from which to filter. In the case of context methods (such as position), the function should return an array with a value for each child in the array. (2) all method calls from XML will have "-" replaced with "_". Therefore, in XML, "local-name()" is identical (and actually becomes) "local_name()" |
| Light | |
| Namespace | Adds named attributes to an object. |
| Node | Represents a node in the tree. Nodes are never encountered except as superclasses of other objects. Nodes have siblings. |
| Parsers | |
| SAX2Listener | A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; REXML doesn’t yet handle doctype entity declarations, so you have to parse them out yourself. |
| StreamListener | A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; REXML doesn’t yet handle doctype entity declarations, so you have to parse them out yourself. |
| Validation | |
| XMLTokens | Defines a number of tokens used for parsing XML. Not for general consumption. |
| Classes | |
|---|---|
| AttlistDecl | This class needs: |
| Attribute | Defines an Element Attribute; IE, a attribute=value pair, as in: <element attribute="value">. Attributes can be in their own namespaces. General users of REXML will not interact with the Attribute class much.</element> |
| Attributes | A class that defines the set of Attributes of an Element and provides operations for accessing elements in that set. |
| CData | |
| Child | A Child object is something contained by a parent, and this class contains methods to support that. Most user code will not use this class directly. |
| Comment | Represents an XML comment; that is, text between <!— … —> |
| Declaration | This is an abstract class. You never use this directly; it serves as a parent class for the specific declarations. |
| DocType | Represents an XML DOCTYPE declaration; that is, the contents of <!DOCTYPE … >. DOCTYPES can be used to declare the DTD of a document, as well as being used to declare entities used in the document. |
| Document | Represents a full XML document, including PIs, a doctype, etc. A Document has a single child that can be accessed by root(). Note that if you want to have an XML declaration written for a document you create, you must add one; REXML documents do not write a default declaration for you. See |DECLARATION| and |write|. |
| Element | Represents a tagged XML element. Elements are characterized by having children, attributes, and names, and can themselves be children. |
| ElementDecl | |
| Elements | A class which provides filtering of children for Elements, and XPath search support. You are expected to only encounter this class as the element.elements object. Therefore, you are not expected to instantiate this yourself. |
| Entity | God, I hate DTDs. I really do. Why this idiot standard still plagues us is beyond me. |
| ExternalEntity | |
| IOSource | A Source that wraps an IO. See the Source class for method documentation |
| Instruction | Represents an XML Instruction; IE, <? … ?> TODO: Add parent arg (3rd arg) to constructor |
| NotationDecl | |
| Output | |
| Parent | A parent has children, and has methods for accessing them. The Parent class is never encountered except as the superclass for some other object. |
| ParseException | |
| QuickPath | |
| Source | A Source can be searched for patterns, and wraps buffers and other objects and provides consumption of text |
| SourceFactory | Generates Source-s. USE THIS CLASS. |
| SyncEnumerator | |
| Text | Represents text nodes in an XML document |
| XMLDecl | NEEDS DOCUMENTATION |
| XPath | Wrapper class. Use this class to access the XPath functions. |
| XPathParser | You don’t want to use this class. Really. Use XPath, which is a wrapper for this class. Believe me. You don’t want to poke around in here. There is strange, dark magic at work in this code. Beware. Go back! Go back while you still can! |
| Constants | |
|---|---|
| COPYRIGHT | |
| Copyright | |
| DATE | |
| REVISION | |
| VERSION | |
| Version | |
<code/>and<pre/>for code samples.