public Method

XmlMarkup.declare!(inst, *args, &block)

Insert an XML declaration into the XML markup.

For example:

xml.declare! :ELEMENT, :blah, "yada"
    # => <!ELEMENT blah "yada">

Source Code

# File builder/xmlmarkup.rb, line 208
def declare!(inst, *args, &block)
  _indent
  @target << "<!#{inst}"
  args.each do |arg|
    case arg
    when String
      @target << %{ "#{arg}"} # " WART
    when Symbol
      @target << " #{arg}"
    end
  end
  if block_given?
    @target << " ["
    _newline
    _nested_structures(block)
    @target << "]"
  end
  @target << ">"
  _newline
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.