new (REXML::DocType)

    # File rexml/doctype.rb, line 45
      def initialize( first, parent=nil )
    			@entities = DEFAULT_ENTITIES
    			if first.kind_of? String
    				super()
    				@name = first
    				@external_id = parent
    			elsif first.kind_of? DocType
    				super(parent)
    				@name = first.name
    				@external_id = first.external_id
    			elsif first.kind_of? Source
    				super(parent)
    				md = first.match( PATTERN_RE, true )
    				identity = md[1]
    				close = md[2]

    				identity =~ IDENTITY
    				@name = $1

    				raise ParseException.new("DOCTYPE is missing a name", first) if @name.nil?

    				@pub_sys = $2.nil? ? nil : $2.strip
    				@long_name = $3.nil? ? nil : $3.strip
    				@uri = $4.nil? ? nil : $4.strip
    				@external_id = nil

    				case @pub_sys
    				when "SYSTEM"
    					@external_id = "SYSTEM"
    				when "PUBLIC"
    					@external_id = "PUBLIC"
    				else
    					# Done, or junk
    				end
    				# If these raise nil exceptions, then the doctype was malformed
    				begin
    					@external_id << " #@long_name" if @long_name
    					@external_id << " #@uri" if @uri
    				rescue
    					raise "malformed DOCTYPE declaration #$&"
    				end

    				return if close == ">"
    				parse_entities first
    			end
    		end