# File nqxml/tokenizer.rb, line 373 def restOfXMLDecl(name, input, sourceStartPos) # Read attributes, if any. attrs = nextTagAttributes('xml decl', name) # Make sure we close with '?>' skipSpaces() if !peekMatches?('?>') str = "malformed processing instruction '#{name}':" + " missing '?>' after attributes" raise ParserError.new(str, self) end skipChars(2) # eat '?>' if attrs['encoding'] && attrs['encoding'] !~ ENCODING_NAME_REGEX str = "xml encoding name \#{attrs['encoding']}\ contains" + " illegal characters" raise ParserError.new(str, self) end if attrs['standalone'] && !(attrs['standalone'] == 'yes' || attrs['standalone'] == 'no') str = "xml standalone attribute \#{attrs['standalone']}\" + " illegal; must be \yes\ or \no\" raise ParserError.new(str, self) end source = input.string[sourceStartPos ... input.pos] return XMLDecl.new(name, attrs, source) end