new( arg = UNDEFINED, parent=nil, context=nil ) public

Constructor

arg

if not supplied, will be set to the default value. If a String, the name of this object will be set to the argument. If an Element, the object will be shallowly cloned; name, attributes, and namespaces will be copied. Children will not be copied.

parent

if supplied, must be a Parent, and will be used as the parent of this object.

context

If supplied, must be a hash containing context items. Context items include:

  • :respect_whitespace the value of this is :all or an array of

strings being the names of the elements to respect
whitespace for.  Defaults to :+all+.
  • :compress_whitespace the value can be :all or an array of

strings being the names of the elements to ignore whitespace on.
Overrides :+respect_whitespace+.
of strings being the names of the elements in which to ignore
whitespace-only nodes.  If this is set, Text nodes which contain only
whitespace will not be added to the document tree.
  • :raw can be :all, or an array of strings being the names of

the elements to process in raw mode.  In raw mode, special
characters in text is not converted to or from entities.
Show source
Register or log in to add new notes.