protected void scanExternalID(String[] identifiers,boolean optionalSystemId) throws IOException, XNIException {
  String systemId=null;
  String publicId=null;
  if (fEntityScanner.skipString("PUBLIC")) {
    if (!fEntityScanner.skipSpaces()) {
      reportFatalError("SpaceRequiredAfterPUBLIC",null);
    }
    scanPubidLiteral(fString);
    publicId=fString.toString();
    if (!fEntityScanner.skipSpaces() && !optionalSystemId) {
      reportFatalError("SpaceRequiredBetweenPublicAndSystem",null);
    }
  }
  if (publicId != null || fEntityScanner.skipString("SYSTEM")) {
    if (publicId == null && !fEntityScanner.skipSpaces()) {
      reportFatalError("SpaceRequiredAfterSYSTEM",null);
    }
    int quote=fEntityScanner.peekChar();
    if (quote != '\'' && quote != '"') {
      if (publicId != null && optionalSystemId) {
        identifiers[0]=null;
        identifiers[1]=publicId;
        return;
      }
      reportFatalError("QuoteRequiredInSystemID",null);
    }
    fEntityScanner.scanChar();
    XMLString ident=fString;
    if (fEntityScanner.scanLiteral(quote,ident) != quote) {
      fStringBuffer.clear();
      do {
        fStringBuffer.append(ident);
        int c=fEntityScanner.peekChar();
        if (XMLChar.isMarkup(c) || c == ']') {
          fStringBuffer.append((char)fEntityScanner.scanChar());
        }
 else         if (XMLChar.isHighSurrogate(c)) {
          scanSurrogates(fStringBuffer);
        }
 else         if (isInvalidLiteral(c)) {
          reportFatalError("InvalidCharInSystemID",new Object[]{Integer.toHexString(c)});
          fEntityScanner.scanChar();
        }
      }
 while (fEntityScanner.scanLiteral(quote,ident) != quote);
      fStringBuffer.append(ident);
      ident=fStringBuffer;
    }
    systemId=ident.toString();
    if (!fEntityScanner.skipChar(quote)) {
      reportFatalError("SystemIDUnterminated",null);
    }
  }
  identifiers[0]=systemId;
  identifiers[1]=publicId;
}

protected void scanExternalID ( String [ ] identifiers , boolean optionalSystemId ) throws IOException , XNIException { String systemId = null ; String publicId = null ; if ( fEntityScanner . skipString ( "PUBLIC" ) ) { if ( ! fEntityScanner . skipSpaces ( ) ) { reportFatalError ( "SpaceRequiredAfterPUBLIC" , null ) ; } scanPubidLiteral ( fString ) ; publicId = fString . toString ( ) ; if ( ! fEntityScanner . skipSpaces ( ) && ! optionalSystemId ) { reportFatalError ( "SpaceRequiredBetweenPublicAndSystem" , null ) ; } } if ( publicId != null || fEntityScanner . skipString ( "SYSTEM" ) ) { if ( publicId == null && ! fEntityScanner . skipSpaces ( ) ) { reportFatalError ( "SpaceRequiredAfterSYSTEM" , null ) ; } int quote = fEntityScanner . peekChar ( ) ; if ( quote != '\'' && quote != '"' ) { if ( publicId != null && optionalSystemId ) { identifiers [ 0 ] = null ; identifiers [ 1 ] = publicId ; return ; } reportFatalError ( "QuoteRequiredInSystemID" , null ) ; } fEntityScanner . scanChar ( ) ; XMLString ident = fString ; if ( fEntityScanner . scanLiteral ( quote , ident ) != quote ) { fStringBuffer . clear ( ) ; do { fStringBuffer . append ( ident ) ; int c = fEntityScanner . peekChar ( ) ; if ( XMLChar . isMarkup ( c ) || c == ']' ) { fStringBuffer . append ( ( char ) fEntityScanner . scanChar ( ) ) ; } else if ( XMLChar . isHighSurrogate ( c ) ) { scanSurrogates ( fStringBuffer ) ; } else if ( isInvalidLiteral ( c ) ) { reportFatalError ( "InvalidCharInSystemID" , new Object [ ] { Integer . toHexString ( c ) } ) ; fEntityScanner . scanChar ( ) ; } } while ( fEntityScanner . scanLiteral ( quote , ident ) != quote ) ; fStringBuffer . append ( ident ) ; ident = fStringBuffer ; } systemId = ident . toString ( ) ; if ( ! fEntityScanner . skipChar ( quote ) ) { reportFatalError ( "SystemIDUnterminated" , null ) ; } } identifiers [ 0 ] = systemId ; identifiers [ 1 ] = publicId ; }
scans external id and return the public and system ids .
