diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-16 17:35:51 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-16 17:35:51 +0000 |
commit | b0d0e2f2e121b3b6fc21f8471596aa5a0a98ddbf (patch) | |
tree | 64b22bcfade785c37b2da0c5e842cd15ce4d814c /lib | |
parent | 32fa87764f107b0f79db4a0c395036bb04b0297f (diff) | |
download | ruby-b0d0e2f2e121b3b6fc21f8471596aa5a0a98ddbf.tar.gz ruby-b0d0e2f2e121b3b6fc21f8471596aa5a0a98ddbf.tar.xz ruby-b0d0e2f2e121b3b6fc21f8471596aa5a0a98ddbf.zip |
------------------------------------------------------------------------
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rexml/doctype.rb | 20 | ||||
-rw-r--r-- | lib/rexml/rexml.rb | 8 |
2 files changed, 19 insertions, 9 deletions
diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb index b523155f8..652a04fce 100644 --- a/lib/rexml/doctype.rb +++ b/lib/rexml/doctype.rb @@ -32,11 +32,12 @@ module REXML # # <!DOCTYPE foo '-//I/Hate/External/IDs'> # dt = DocType.new( doctype_to_clone ) # # Incomplete. Shallow clone of doctype - # source = Source.new( '<!DOCTYPE foo "bar">' ) - # dt = DocType.new( source ) - # # <!DOCTYPE foo "bar"> - # dt = DocType.new( source, some_document ) - # # Creates a doctype, and adds to the supplied document + # + # +Note+ that the constructor: + # + # Doctype.new( Source.new( "<!DOCTYPE foo 'bar'>" ) ) + # + # 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 200f2c03a..da1b88ddd 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 <serATgermaneHYPHENsoftwareDOTcom> -# 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 <ser@germane-software.com>" - Date = "+2004/114" - Version = "3.0.4" + Date = "+2004/137" + Version = "3.0.7" end |