Method: NXML#to_str
- Defined in:
- lib/nxml.rb
#to_str ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/nxml.rb', line 168 def to_str ret = "<?xml" if @root.nil? end if not @version.nil? ret += " version=\"#{@version}\"" end if not @encoding.nil? ret += " encoding=\"#{@encoding.name}\"" end if not @standalone.nil? ret += " standalone=\"#{@standalone ? "yes" : "no"}\"" end ret += "?>\n" ret += @root ret.encode @encoding end |