while (fEntityScanner.peekChar() != '?') { dataFoundForTarget = true; String name = scanPseudoAttribute(scanningTextDecl, fString); switch (state) { case STATE_VERSION: { if (name == fVersionSymbol) { if (!sawSpace) { reportFatalError(scanningTextDecl ? "SpaceRequiredBeforeVersionInTextDecl" : "SpaceRequiredBeforeVersionInXMLDecl", if (!versionSupported(version)) { reportFatalError(getVersionNotSupportedKey(), new Object[]{version}); reportFatalError("VersionInfoRequired", null); reportFatalError(scanningTextDecl ? "SpaceRequiredBeforeEncodingInTextDecl" : "SpaceRequiredBeforeEncodingInXMLDecl", reportFatalError("EncodingDeclRequired", null); reportFatalError("VersionInfoRequired", null); if (name == fEncodingSymbol) { if (!sawSpace) { reportFatalError(scanningTextDecl ? "SpaceRequiredBeforeEncodingInTextDecl"
protected void reset() { init(); // DTD preparsing defaults: fValidation = true; fNotifyCharRefs = false; }
if (c != -1) { if (XMLChar.isHighSurrogate(c)) { scanSurrogates(text); else if (isInvalidLiteral(c)) { reportFatalError("InvalidCharInComment", new Object[] { Integer.toHexString(c) }); fEntityScanner.scanChar(); reportFatalError("DashDashInComment", null);
/** * Scans a processing instruction. * <p> * <pre> * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' * [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) * </pre> * <strong>Note:</strong> This method uses fString, anything in it * at the time of calling is lost. */ protected void scanPI() throws IOException, XNIException { // target fReportEntity = false; String target = null; if(fNamespaces) { target = fEntityScanner.scanNCName(); } else { target = fEntityScanner.scanName(); } if (target == null) { reportFatalError("PITargetRequired", null); } // scan data scanPIData(target, fString); fReportEntity = true; } // scanPI()
reportFatalError("OpenQuoteExpected", new Object[]{eleName,atName}); if (c == quote && (fromIndex = isUnchangedByNormalization(value)) == -1) { reportFatalError("CloseQuoteExpected", new Object[]{eleName,atName}); normalizeWhitespace(value, fromIndex); if (DEBUG_ATTR_NORMALIZATION) { System.out.println("** normalizeWhitespace -> \"" int ch = scanCharReferenceValue(fStringBuffer, fStringBuffer2); if (ch != -1) { if (DEBUG_ATTR_NORMALIZATION) { String entityName = fEntityScanner.scanName(); if (entityName == null) { reportFatalError("NameRequiredInReference", null); reportFatalError("SemicolonRequiredInReference", new Object []{entityName}); reportFatalError("ReferenceToExternalEntity", new Object[] { entityName }); reportFatalError("EntityNotDeclared", new Object[]{entityName}); reportFatalError("LessthanInAttValue", new Object[] { eleName, atName });
if (fEntityScanner.skipString("PUBLIC")) { if (!fEntityScanner.skipSpaces()) { reportFatalError("SpaceRequiredAfterPUBLIC", null); scanPubidLiteral(fString); publicId = fString.toString(); reportFatalError("SpaceRequiredBetweenPublicAndSystem", null); reportFatalError("SpaceRequiredAfterSYSTEM", null); return; reportFatalError("QuoteRequiredInSystemID", null); scanSurrogates(fStringBuffer); else if (isInvalidLiteral(c)) { reportFatalError("InvalidCharInSystemID", new Object[] { Integer.toHexString(c) }); fEntityScanner.scanChar(); reportFatalError("SystemIDUnterminated", null);
String name = scanPseudoAttributeName(); XMLEntityManager.print(fEntityManager.getCurrentEntity()); if (name == null) { reportFatalError("PseudoAttrNameExpected", null); reportFatalError(scanningTextDecl ? "EqRequiredInTextDecl" : "EqRequiredInXMLDecl", new Object[]{name}); int quote = fEntityScanner.peekChar(); if (quote != '\'' && quote != '"') { reportFatalError(scanningTextDecl ? "QuoteRequiredInTextDecl" : "QuoteRequiredInXMLDecl" , new Object[]{name}); scanSurrogates(fStringBuffer2); else if (isInvalidLiteral(c)) { String key = scanningTextDecl ? "InvalidCharInTextDecl" : "InvalidCharInXMLDecl"; reportFatalError(key, new Object[] {Integer.toString(c, 16)}); fEntityScanner.scanChar(); reportFatalError(scanningTextDecl ? "CloseQuoteMissingInTextDecl" : "CloseQuoteMissingInXMLDecl", new Object[]{name});
int low = fEntityScanner.peekChar(); if (!XMLChar.isLowSurrogate(low)) { reportFatalError("InvalidCharInContent", new Object[] {Integer.toString(high, 16)}); return false; if (isInvalid(c)) { reportFatalError("InvalidCharInContent", new Object[]{Integer.toString(c, 16)}); return false;
/** * reset * * @param componentManager */ public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { super.reset(componentManager); init(); } // reset(XMLComponentManager)
/** * This method notifies the end of an entity. The DTD has the pseudo-name * of "[dtd]" parameter entity names start with '%'; and general entities * are just specified by their name. * * @param name The name of the entity. * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */ public void endEntity(String name, Augmentations augs) throws XNIException { // flush possible pending output buffer - see scanContent if (fInScanContent && fStringBuffer.length != 0 && fDocumentHandler != null) { fDocumentHandler.characters(fStringBuffer, null); fStringBuffer.length = 0; // make sure we know it's been flushed } super.endEntity(name, augs); // make sure markup is properly balanced if (fMarkupDepth != fEntityStack[fEntityDepth]) { reportFatalError("MarkupEntityMismatch", null); } // call handler if (fDocumentHandler != null && !fScanningAttribute) { if (!name.equals("[xml]")) { fDocumentHandler.endGeneralEntity(name, augs); } } } // endEntity(String)
reportFatalError("QuoteRequiredInPublicID", null); return false; reportFatalError("PublicIDUnterminated", null); return false; reportFatalError("InvalidCharInPublicID", new Object[]{Integer.toHexString(c)});
reportFatalError("HexdigitRequiredInCharRef", null); reportFatalError("DigitRequiredInCharRef", null); reportFatalError("SemicolonRequiredInCharRef", null); if (isInvalid(value)) { StringBuffer errorBuf = new StringBuffer(fStringBuffer3.length + 1); if (hex) errorBuf.append('x'); errorBuf.append(fStringBuffer3.ch, fStringBuffer3.offset, fStringBuffer3.length); reportFatalError("InvalidCharRef", new Object[]{errorBuf.toString()}); if (hex) errorBuf.append('x'); errorBuf.append(fStringBuffer3.ch, fStringBuffer3.offset, fStringBuffer3.length); reportFatalError("InvalidCharRef", new Object[]{errorBuf.toString()});
public void reset() { super.reset(); init(); }
throws XNIException { super.endEntity(name, augs);
char c2 = Character.toLowerCase(target.charAt(2)); if (c0 == 'x' && c1 == 'm' && c2 == 'l') { reportFatalError("ReservedPITarget", null); if (str != null) colonName.append(str); reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()}); fEntityScanner.skipSpaces(); } else { reportFatalError("SpaceRequiredInPI", null); if (c != -1) { if (XMLChar.isHighSurrogate(c)) { scanSurrogates(fStringBuffer); else if (isInvalidLiteral(c)) { reportFatalError("InvalidCharInPI", new Object[]{Integer.toHexString(c)}); fEntityScanner.scanChar();
throws XMLConfigurationException { super.reset(componentManager);