Class: REXML::CData
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
REXML::Text
|
| Defined in: | lib/rexml/cdata.rb |
Constant Summary
-
ILLEGAL =
# File 'lib/rexml/cdata.rb', line 8/(\]\]>)/ -
START =
# File 'lib/rexml/cdata.rb', line 6'<![CDATA[' -
STOP =
# File 'lib/rexml/cdata.rb', line 7']]>'
Text - Inherited
EREFERENCE, NEEDS_A_SECOND_CHECK, NUMERICENTITY, REFERENCE, SETUTITSBUS, SLAICEPS, SPECIALS, SUBSTITUTES, VALID_CHAR, VALID_XML_CHARS
Class Method Summary
-
.new(first, whitespace = true, parent = nil) ⇒ CData
constructor
Constructor.
Text - Inherited
| .check | check for illegal characters. |
| .new | Constructor |
| .expand, | |
| .normalize | Escapes all possible entities. |
| .read_with_substitution | Reads text, substituting entities. |
| .unnormalize | Unescapes all possible entities. |
Child - Inherited
| .new | Constructor. |
Instance Attribute Summary
Text - Inherited
| #empty?, #parent=, | |
| #raw | If |
| #value | Returns the string value of this text. |
| #value= | Sets the contents of this text node. |
Child - Inherited
| #next_sibling | Alias for Node#next_sibling_node. |
| #next_sibling= | Sets the next sibling of this child. |
| #parent | The Parent of this object. |
| #parent= | Sets the parent of this child to the supplied argument. |
| #previous_sibling | Alias for Node#previous_sibling_node. |
| #previous_sibling= | Sets the previous sibling of this child. |
Node - Included
Instance Method Summary
-
#clone
Make a copy of this object.
-
#to_s
Returns the content of this
CDataobject. - #value
-
#write(output = $stdout, indent = -1,, transitive = false, ie_hack = false)
DEPRECATED See the rexml/formatters package.
Text - Inherited
| #<< | Appends text to this text node. |
| #<=> |
|
| #clone, #doctype, #indent_text, #inspect, #node_type, | |
| #to_s | Returns the string value of this text node. |
| #wrap, | |
| #write | DEPRECATED See Formatters |
| #write_with_substitution | Writes out text, substituting special characters beforehand. |
| #xpath | FIXME This probably won't work properly. |
| #clear_cache | |
Child - Inherited
| #bytes | This doesn't yet handle encodings. |
| #document |
|
| #remove | Removes this child from the parent. |
| #replace_with | Replaces this object with another object. |
Node - Included
| #each_recursive | Visit all subnodes of |
| #find_first_recursive | Find (and return) first subnode (recursively) for which the block evaluates to true. |
| #indent, | |
| #index_in_parent | Returns the position that |
| #next_sibling_node, #previous_sibling_node, | |
| #to_s |
|
Constructor Details
.new(first, whitespace = true, parent = nil) ⇒ CData
Constructor. CData is data between <![CDATA[ … ]]>
Examples
CData.new( source )
CData.new( "Here is some CDATA" )
CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
# File 'lib/rexml/cdata.rb', line 16
def initialize( first, whitespace=true, parent=nil ) super( first, whitespace, parent, false, true, ILLEGAL ) end
Instance Method Details
#clone
# File 'lib/rexml/cdata.rb', line 26
def clone CData.new self end
#to_s
Returns the content of this CData object
Examples
c = CData.new( "Some text" )
c.to_s # -> "Some text"
# File 'lib/rexml/cdata.rb', line 35
def to_s @string end
#value
[ GitHub ]# File 'lib/rexml/cdata.rb', line 39
def value @string end
#write(output = $stdout, indent = -1,, transitive = false, ie_hack = false)
DEPRECATED
See the rexml/formatters package
Generates XML output of this object
- output
-
Where to write the string. Defaults to $stdout
- indent
-
The amount to indent this node by
- transitive
-
Ignored
- ie_hack
-
Ignored
Examples
c = CData.new( " Some text " )
c.write( $stdout ) #-> <![CDATA[ Some text ]]>