1 require "rexml/dtd/elementdecl"
2 require "rexml/dtd/entitydecl"
3 require "rexml/comment"
4 require "rexml/dtd/notationdecl"
5 require "rexml/dtd/attlistdecl"
11 def Parser.parse( input )
16 parse_helper input.read
20 # Takes a String and parses it out
21 def Parser.parse_helper( input )
25 when ElementDecl.PATTERN_RE
28 contents << ElementDecl.new( match )
29 when AttlistDecl.PATTERN_RE
32 contents << AttlistDecl.new( matchdata )
33 when EntityDecl.PATTERN_RE
36 contents << EntityDecl.new( matchdata )
37 when Comment.PATTERN_RE
40 contents << Comment.new( matchdata )
41 when NotationDecl.PATTERN_RE
44 contents << NotationDecl.new( matchdata )