|
def write(writer, indent=-1, transitive=false)
#print "ID:#{indent}"
writer << "<#@expanded_name"
@attributes.each_attribute do |attr|
writer << " "
attr.write( writer, indent )
end unless @attributes.empty?
if @children.empty?
writer << "/"
else
if transitive and indent>-1 and !@children[0].kind_of? Text
writer << "\n"
indent writer, indent+2
end
writer << ">"
write_children writer, indent, transitive
writer << "</#{expanded_name}"
end
if transitive and indent>-1
writer << "\n"
indent -= 2 if next_sibling.nil?
indent writer, indent
end
writer << ">"
end
|