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 | fcc9c6eab39a535efb827e5fd556dc043bdff6e6 (patch) | |
tree | 64b22bcfade785c37b2da0c5e842cd15ce4d814c /lib | |
parent | 620549da3f87717471248b09467d0b59b6844238 (diff) | |
download | ruby-fcc9c6eab39a535efb827e5fd556dc043bdff6e6.tar.gz |
------------------------------------------------------------------------
git-svn-id: svn+ssh://ci.ruby-lang.org/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 b523155f8f..652a04fce2 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 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 <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 |