method
new
v1_8_7_72 -
Show latest stable
- Class:
REXML::DTD::EntityDecl
new(src)public
<!ENTITY name SYSTEM "…"> <!ENTITY name "…">
# File lib/rexml/dtd/entitydecl.rb, line 13
def initialize src
super()
md = nil
if src.match( PUBLIC )
md = src.match( PUBLIC, true )
@middle = "PUBLIC"
@content = "#{md[2]} #{md[4]}"
elsif src.match( SYSTEM )
md = src.match( SYSTEM, true )
@middle = "SYSTEM"
@content = md[2]
elsif src.match( PLAIN )
md = src.match( PLAIN, true )
@middle = ""
@content = md[2]
elsif src.match( PERCENT )
md = src.match( PERCENT, true )
@middle = ""
@content = md[2]
end
raise ParseException.new("failed Entity match", src) if md.nil?
@name = md[1]
end Related methods
- Instance methods
- to_s
- write
- Class methods
- new
- parse_source