summaryrefslogtreecommitdiff
path: root/lib/rexml/xmldecl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/xmldecl.rb')
-rw-r--r--lib/rexml/xmldecl.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index b65604b762..427eb78cf8 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -13,7 +13,7 @@ module REXML
STOP = '\?>';
attr_accessor :version, :standalone
- attr_reader :writeencoding
+ attr_reader :writeencoding, :writethis
def initialize(version=DEFAULT_VERSION, encoding=nil, standalone=nil)
@writethis = true
@@ -37,9 +37,14 @@ module REXML
XMLDecl.new(self)
end
- def write writer, indent=-1, transitive=false, ie_hack=false
+ # indent::
+ # Ignored. There must be no whitespace before an XML declaration
+ # transitive::
+ # Ignored
+ # ie_hack::
+ # Ignored
+ def write(writer, indent=-1, transitive=false, ie_hack=false)
return nil unless @writethis or writer.kind_of? Output
- indent( writer, indent )
writer << START.sub(/\\/u, '')
if writer.kind_of? Output
writer << " #{content writer.encoding}"