Class REXML::Text
In: rexml/text.rb
Parent: Child

Represents text in an XML document

<=>    clone    empty?    new    normalize    parse_stream    pull    read_with_substitution    to_s    unnormalize    write    write_with_substitution   
:raw  [RW] 
:string  [R] 

string is String content, raw is a boolean

Included modules
Public Class methods
new(arg, respect_whitespace=false, parent=nil, pattern=PATTERN, raw=false)

Constructor @param arg if a String, the content is set to the String. If a Text, the object is shallowly cloned. If a Source, the source is parsed for text content up to the next element. If a parent, the parent of this object is set to the argument. @param whitespace (boolean, optional) if true, whitespace is respected @param parent (Parent, optional) if given, the parent of this object will be set to the argument

parse_stream(source, listener)
read_with_substitution( input, illegal=nil )

Reads text, substituting entities

normalize( input, doctype=nil )
unnormalize( string, doctype=nil, illegal=nil )
Public Instance methods
<=>( other )

@param other a String or a Text @return the result of (to_s <=> arg.to_s)


Returns an UNNORMALIZED value; IE, entities that can be replaced have been replaced.

write( writer, indent=-1, transitive=false )
write_with_substitution(out, input)

Writes out text, substituting special characters beforehand. @param out A String, IO, or any other object supporting <<( String ) @param input the text to substitute and the write out

z=utf8.unpack("U*") ascOut="" z.each{|r|

  if r <  0x100
    ascOut.concat(sprintf("&#x%x;", r))

} puts ascOut