From fcc9c6eab39a535efb827e5fd556dc043bdff6e6 Mon Sep 17 00:00:00 2001 From: ser Date: Sun, 16 May 2004 17:35:51 +0000 Subject: ------------------------------------------------------------------------ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/doctype.rb | 20 +++++++++++++++----- lib/rexml/rexml.rb | 8 ++++---- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb index b523155f8f..652a04fce2 100644 --- a/lib/rexml/doctype.rb +++ b/lib/rexml/doctype.rb @@ -32,11 +32,12 @@ module REXML # # # dt = DocType.new( doctype_to_clone ) # # Incomplete. Shallow clone of doctype - # source = Source.new( '' ) - # dt = DocType.new( source ) - # # - # dt = DocType.new( source, some_document ) - # # Creates a doctype, and adds to the supplied document + # + # +Note+ that the constructor: + # + # Doctype.new( Source.new( "" ) ) + # + # is _deprecated_. Do not use it. It will probably disappear. def initialize( first, parent=nil ) @entities = DEFAULT_ENTITIES @long_name = @uri = nil @@ -54,6 +55,15 @@ module REXML @external_id = first[1] @long_name = first[2] @uri = first[3] + elsif first.kind_of? Source + super( parent ) + parser = Parsers::BaseParser.new( first ) + event = parser.pull + if event[0] == :start_doctype + @name, @external_id, @long_name, @uri, = event[1..-1] + end + else + super() end end diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb index 200f2c03aa..da1b88ddd3 100644 --- a/lib/rexml/rexml.rb +++ b/lib/rexml/rexml.rb @@ -10,8 +10,8 @@ # # Main page:: http://www.germane-software.com/software/rexml # Author:: Sean Russell -# Version:: 3.0.4 -# Date:: +2004/114 +# Version:: 3.0.7 +# Date:: +2004/137 # # This API documentation can be downloaded from the REXML home page, or can # be accessed online[http://www.germane-software.com/software/rexml_doc] @@ -21,6 +21,6 @@ # online[http://www.germane-software.com/software/rexml/docs/tutorial.html] module REXML Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell " - Date = "+2004/114" - Version = "3.0.4" + Date = "+2004/137" + Version = "3.0.7" end -- cgit v1.2.3