GIF87a;
require "rexml/child" module REXML ## # Represents an XML comment; that is, text between \<!-- ... --> class Comment < Child include Comparable START = "<!--" STOP = "-->" # The content text attr_accessor :string ## # Constructor. The first argument can be one of three types: # @param first If String, the contents of this comment are set to the # argument. If Comment, the argument is duplicated. If # Source, the argument is scanned for a comment. # @param second If the first argument is a Source, this argument # should be nil, not supplied, or a Parent to be set as the parent # of this object def initialize( first, second = nil ) #puts "IN COMMENT CONSTRUCTOR; SECOND IS #{second.type}" super(second) if first.kind_of? String @string = first elsif first.kind_of? Comment @string = first.string end end def clone Comment.new self end # == DEPRECATED # See REXML::Formatters # # output:: # Where to write the string # indent:: # An integer. If -1, no indenting will be used; otherwise, the # indentation will be this number of spaces, and children will be # indented an additional amount. # transitive:: # Ignored by this class. The contents of comments are never modified. # ie_hack:: # Needed for conformity to the child API, but not used by this class. def write( output, indent=-1, transitive=false, ie_hack=false ) Kernel.warn("Comment.write is deprecated. See REXML::Formatters") indent( output, indent ) output << START output << @string output << STOP end alias :to_s :string ## # Compares this Comment to another; the contents of the comment are used # in the comparison. def <=>(other) other.to_s <=> @string end ## # Compares this Comment to another; the contents of the comment are used # in the comparison. def ==( other ) other.kind_of? Comment and (other <=> self) == 0 end def node_type :comment end end end #vim:ts=2 sw=2 noexpandtab:
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
dtd | Folder | 0755 |
|
|
formatters | Folder | 0755 |
|
|
light | Folder | 0755 |
|
|
parsers | Folder | 0755 |
|
|
validation | Folder | 0755 |
|
|
attlistdecl.rb | File | 1.89 KB | 0644 |
|
attribute.rb | File | 5.39 KB | 0644 |
|
cdata.rb | File | 1.54 KB | 0644 |
|
child.rb | File | 2.63 KB | 0644 |
|
comment.rb | File | 2.14 KB | 0644 |
|
doctype.rb | File | 6.58 KB | 0644 |
|
document.rb | File | 9.52 KB | 0644 |
|
element.rb | File | 43.85 KB | 0644 |
|
encoding.rb | File | 1.13 KB | 0644 |
|
entity.rb | File | 5.53 KB | 0644 |
|
functions.rb | File | 11.27 KB | 0644 |
|
instruction.rb | File | 2.01 KB | 0644 |
|
namespace.rb | File | 1.09 KB | 0644 |
|
node.rb | File | 2.13 KB | 0644 |
|
output.rb | File | 519 B | 0644 |
|
parent.rb | File | 4.33 KB | 0644 |
|
parseexception.rb | File | 1.22 KB | 0644 |
|
quickpath.rb | File | 9.08 KB | 0644 |
|
rexml.rb | File | 1.65 KB | 0644 |
|
sax2listener.rb | File | 3.6 KB | 0644 |
|
source.rb | File | 7.6 KB | 0644 |
|
streamlistener.rb | File | 3.88 KB | 0644 |
|
syncenumerator.rb | File | 685 B | 0644 |
|
text.rb | File | 13.57 KB | 0644 |
|
undefinednamespaceexception.rb | File | 210 B | 0644 |
|
xmldecl.rb | File | 2.68 KB | 0644 |
|
xmltokens.rb | File | 526 B | 0644 |
|
xpath.rb | File | 3.31 KB | 0644 |
|
xpath_parser.rb | File | 25.7 KB | 0644 |
|