lib/ess/element.rb
##
# Returns the feed as an XML document in a string. An Builder::XmlMarkup
# object can be passed as an argument and used as output, instead of
# generating a string object.
#
Returns the feed as an XML document in a string. An Builder::XmlMarkup
object can be passed as an argument and used as output, instead of
generating a string object.
Returns the feed as an XML document in a string . An Builder :: XmlMarkup object can be passed as an argument and used as output instead of generating a string object .
def to_xml! xml=nil
      convert_to_string = true if xml.nil?
      xml = Builder::XmlMarkup.new if xml.nil?
      if @name == :ess
        xml.instruct! :xml, :encoding => "UTF-8"
        xml.declare! :DOCTYPE, :ess, :PUBLIC, "-//ESS//DTD", "http://essfeed.org/history/0.9/index.dtd"
      end
      xml.tag! @name, attributes do |p|
        if !@text.nil?
          if @dtd[:cdata]
            p.cdata! @text
          else
            p.text! @text
          end
        end
        child_tags.values.each { |tag_list| tag_list.each { |tag| tag.to_xml!(p) } }
      end
      xml.target! if convert_to_string
    end
def to_xml! xml = nil convert_to_string = true if xml . nil? xml = Builder :: XmlMarkup . new if xml . nil? if @name == :ess xml . instruct! :xml , :encoding => "UTF-8" xml . declare! :DOCTYPE , :ess , :PUBLIC , "-//ESS//DTD" , "http://essfeed.org/history/0.9/index.dtd" end xml . tag! @name , attributes do | p | if ! @text . nil? if @dtd [ :cdata ] p . cdata! @text else p . text! @text end end child_tags . values . each { | tag_list | tag_list . each { | tag | tag . to_xml! ( p ) } } end xml . target! if convert_to_string end
Returns the feed as an XML document in a string.
Returns the feed as an XML document in a string .
xml
<not_specific>