note description: "Common ancestor for feed generator." date: "$Date$" revision: "$Revision$" deferred class FEED_GENERATOR inherit XML_UTILITIES feature {NONE} -- Initialization make (a_buffer: STRING_8) do buffer := a_buffer create indentation.make_empty end feature -- Access buffer: STRING_8 -- Output of feed conversion. feature -- Conversion process_feed (a_feed: FEED) -- Convert `a_feed' into string representation in `buffer'. deferred end feature {NONE} -- Helpers indent do indentation.append ("%T") end exdent require has_indentation: indentation.count > 0 do indentation.remove_tail (1) end indentation: STRING append_content_tag_to (a_tagname: READABLE_STRING_8; a_attr: detachable ITERABLE [TUPLE [name: READABLE_STRING_8; value: detachable READABLE_STRING_GENERAL]]; a_content: detachable READABLE_STRING_GENERAL; a_output: STRING) local l_is_xhtml_type: BOOLEAN do if a_content /= Void or a_attr /= Void then a_output.append (indentation) a_output.append ("<") a_output.append (a_tagname) if a_attr /= Void then across a_attr as ic loop if attached ic.item.value as l_att_value then a_output.append_character (' ') a_output.append (ic.item.name) a_output.append_character ('=') a_output.append_character ('%"') a_output.append (escaped_xml (l_att_value)) a_output.append_character ('%"') if ic.item.name.same_string ("type") and then l_att_value.same_string ("xhtml") then l_is_xhtml_type := True end end end end if a_content = Void then a_output.append ("/>%N") else a_output.append (">") if l_is_xhtml_type then a_output.append ("