mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
------------------------------------------------------------------------
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
620549da3f
commit
fcc9c6eab3
2 changed files with 19 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue