| Class | REXML::DTD::Parser |
| In: |
rexml/dtd/dtd.rb
|
| Parent: | Object |
# File rexml/dtd/dtd.rb, line 11 def Parser.parse( input ) case input when String parse_helper input when File parse_helper input.read end end
Takes a String and parses it out
# File rexml/dtd/dtd.rb, line 21 def Parser.parse_helper( input ) contents = Parent.new while input.size > 0 case input when ElementDecl.PATTERN_RE match = $& source = $' contents << ElementDecl.new( match ) when AttlistDecl.PATTERN_RE matchdata = $~ source = $' contents << AttlistDecl.new( matchdata ) when EntityDecl.PATTERN_RE matchdata = $~ source = $' contents << EntityDecl.new( matchdata ) when Comment.PATTERN_RE matchdata = $~ source = $' contents << Comment.new( matchdata ) when NotationDecl.PATTERN_RE matchdata = $~ source = $' contents << NotationDecl.new( matchdata ) end end contents end
ruby-doc.org is a community service provided by Happy Camper Studios, a Phoenix, Arizona, Ruby application development company.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.