write(out, indent=-1)
public
Write out a fully formed, correct entity definition (assuming the Entity
object itself is valid.)
out: | An object implementing <TT><<<TT> to which the
entity will be output
|
indent: | DEPRECATED and ignored
|
Show source
def write out, indent=-1
out << '<!ENTITY '
out << '% ' if @reference
out << @name
out << ' '
if @external
out << @external << ' '
if @pubid
q = @pubid.include?('"')?"'":'"'
out << q << @pubid << q << ' '
end
q = @ref.include?('"')?"'":'"'
out << q << @ref << q
out << ' NDATA ' << @ndata if @ndata
else
q = @value.include?('"')?"'":'"'
out << q << @value << q
end
out << '>'
end