# XMLRPC::XMLWriter::Simple (Class)

In: | xmlrpc/create.rb
Parent: | Abstract

## Methods

document document_to_str element pi text

## Public Instance methods

document_to_str(doc)

[Source]

    # File xmlrpc/create.rb, line 29
          def document_to_str(doc)
            doc
          end

document(*params)

[Source]

    # File xmlrpc/create.rb, line 33
          def document(*params)
            params.join("")
          end

pi(name, *params)

[Source]

    # File xmlrpc/create.rb, line 37
          def pi(name, *params)
            "<?#{name} " + params.join(" ") + " ?>"
          end

element(name, attrs, *children)

[Source]

    # File xmlrpc/create.rb, line 41
          def element(name, attrs, *children)
            raise "attributes not yet implemented" unless attrs.nil?
            if children.empty?
              "<#{name}/>"
            else
              "<#{name}>" + children.join("") + "</#{name}>"
            end
          end

text(txt)

[Source]

    # File xmlrpc/create.rb, line 50
          def text(txt)
            cleaned = txt.dup
            cleaned.gsub!(/&/, '&amp;')
            cleaned.gsub!(/</, '&lt;')
            cleaned.gsub!(/>/, '&gt;')
            cleaned
          end

[Validate]