summaryrefslogtreecommitdiff
path: root/lib/rexml/document.rb
diff options
context:
space:
mode:
authorser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-04 04:50:15 +0000
committerser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-04 04:50:15 +0000
commit37886ed9a8205673ce073153f762ab05eca13ac5 (patch)
treed3489b735a95f2870cc14e0fbb01b5933a173951 /lib/rexml/document.rb
parent80018be1fb538641742ccf8f1edfe6ba975a2b95 (diff)
Fixes a bug in the pretty printer related to an incomplete refactoring.
Fixes another bug related to the formatting code refactoring in 3.1.7 Fixes ticket:99, and adds Henrik's unit test (with minor modifications) Fixes ticket:102. Fix provided by kevinj -- thanks! Great job. Implements namespace validation in the baseparser. This means that, as per the XML namespace spec, unbound prefixes generate UndefinedNamespaceException. Also, as per the namespace spec, the 'xml' prefix must be bound to http://www.w3.org/XML/1998/namespace, and the 'xmlns' prefix must not be declared. in the XML. Fix for ticket:115 Fixes a bug in the pretty printer related to an incomplete refactoring. Merge code cleanups Fixes another bug related to the formatting code refactoring in 3.1.7 Indentation fix. lib/rexml/formatters/*.rb: set properties. lib/rexml/encodings/{ISO-8859-15,CP-1252}.rb: fixed invalid syntax. lib/rexml/rexml.rb: removed doubled constant. lib/rexml/rexml.rb: added encoding. Fixes ticket:110 Missing include for UndefinedNamespaceException was causing errors in some cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/document.rb')
-rw-r--r--lib/rexml/document.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb
index 558b5d731a..81e63c60f1 100644
--- a/lib/rexml/document.rb
+++ b/lib/rexml/document.rb
@@ -66,6 +66,7 @@ module REXML
def add( child )
if child.kind_of? XMLDecl
@children.unshift child
+ child.parent = self
elsif child.kind_of? DocType
# Find first Element or DocType node and insert the decl right
# before it. If there is no such node, just insert the child at the
@@ -183,7 +184,7 @@ module REXML
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1
- if transitive
+ if trans
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )