Ruby on Rails latest stable (v4.2.1) - 0 notes - Superclass: Builder::XmlMarkup
  • 1.0.0 (0)
  • 1.1.1
  • 1.1.6
  • 1.2.0
  • 1.2.6
  • 2.0.0
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.2
  • 2.3.8
  • 3.0.0
  • 3.0.5
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.3
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • 4.1.8
  • 4.2.1
  • What's this?

Class deprecated or moved

This class is deprecated or moved on the latest stable version. The last existing version (v1.0.0) is shown here.

Create a series of SAX-like XML events (e.g. start_tag, end_tag) from the markup code. XmlEvent objects are used in a way similar to XmlMarkup objects, except that a series of events are generated and passed to a handler rather than generating character-based markup.


  xe = Builder::XmlEvents.new(hander)
  xe.title("HI")    # Sends start_tag/end_tag/text messages to the handler.

Indentation may also be selected by providing value for the indentation size and initial indentation level.

  xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level)

XML Event Handler

The handler object must expect the following events.

start_tag(tag, attrs)
Announces that a new tag has been found. tag is the name of the tag and attrs is a hash of attributes for the tag.
Announces that an end tag for tag has been found.
Announces that a string of characters (text) has been found. A series of characters may be broken up into more than one text call, so the client cannot assume that a single callback contains all the text data.
Show files where this class is defined (1 file)
Register or log in to add new notes.