5 # Represents an XML comment; that is, text between \<!-- ... -->
16 # Constructor. The first argument can be one of three types:
17 # @param first If String, the contents of this comment are set to the
18 # argument. If Comment, the argument is duplicated. If
19 # Source, the argument is scanned for a comment.
20 # @param second If the first argument is a Source, this argument
21 # should be nil, not supplied, or a Parent to be set as the parent
23 def initialize( first, second = nil )
24 #puts "IN COMMENT CONSTRUCTOR; SECOND IS #{second.type}"
26 if first.kind_of? String
28 elsif first.kind_of? Comment
29 @string = first.string
38 # See REXML::Formatters
41 # Where to write the string
43 # An integer. If -1, no indenting will be used; otherwise, the
44 # indentation will be this number of spaces, and children will be
45 # indented an additional amount.
47 # Ignored by this class. The contents of comments are never modified.
49 # Needed for conformity to the child API, but not used by this class.
50 def write( output, indent=-1, transitive=false, ie_hack=false )
51 Kernel.warn("Comment.write is deprecated. See REXML::Formatters")
52 indent( output, indent )
61 # Compares this Comment to another; the contents of the comment are used
64 other.to_s <=> @string
68 # Compares this Comment to another; the contents of the comment are used
71 other.kind_of? Comment and
80 #vim:ts=2 sw=2 noexpandtab: