# File nqxml/tokenizer.rb, line 485 def nextExternalId(tagName) externalId = nil idSourceStartPos = @currInput.pos if peekMatches?('PUBLIC') skipChars(6) skipSpaces() pubid = nextPublicIdLiteral(tagName) skipSpaces() c = peekChar() if c == '>' || c == '[' str = "#{tagName} tag's PUBLIC external id requires two" + " arguments; only one seen" raise ParserError.new(str, self) end # c is quote char (we need to hang on to it because we # loose it in nextQuotedLiteral()). If the next char isn't # a quote char, then nextQuotedLiteral() will do the # complaining for us. system = c + nextQuotedLiteral("#{tagName} (PUBLIC)") + c source = @currInput.string[idSourceStartPos ... @currInput.pos] externalId = PublicExternalID.new(pubid, system, source) elsif peekMatches?('SYSTEM') skipChars(6) skipSpaces() c = peekChar() # Grab quote char system = c + nextQuotedLiteral("#{tagName} (SYSTEM)") + c source = @currInput.string[idSourceStartPos ... @currInput.pos] externalId = SystemExternalID.new(system, source) # A bit of extra error checking skipSpaces() if peekChar() == '"' str = "#{tagName} tag's SYSTEM external id only has one" + " argument; two seen" raise ParserError.new(str, self) end end return externalId end