throws XMLStreamException String id = ed.getName(); if (!ed.isParsed()) { throwParseError("Illegal reference to unparsed external entity \"{0}\"", id, null); boolean isExt = ed.isExternal(); if (isExt) { if (!allowExt) { // never ok in attribute value... WstxInputSource newInput = null; try { newInput = ed.expand(oldInput, mEntityResolver, mConfig, mDocXmlVersion); } catch (FileNotFoundException fex) {
ent.markAsExternallyDeclared(); EntityDecl oldED = (EntityDecl) old; String str = " entity '"+id+"' defined more than once: first declaration at " + oldED.getLocation(); if (isParam) { str = "Parameter" + str; if (ent.isParsed()) { // Parsed GE or PE } else { // unparsed GE final URL src; throw new WstxIOException(e); mEventListener.dtdUnparsedEntityDecl(id, ent.getPublicId(), ent.getSystemId(), ent.getNotationName(), src);
public char[] getTextCharacters() { if (((1 << mCurrToken) & MASK_GET_TEXT_XXX) == 0) { throwNotTextXxx(mCurrToken); } if (mTokenState < mStTextThreshold) { safeFinishToken(); } if (mCurrToken == ENTITY_REFERENCE) { return mCurrEntity.getReplacementChars(); } if (mCurrToken == DTD) { return getDTDInternalSubsetArray(); } return mTextBuffer.getTextBuffer(); }
protected EntityDecl findEntity(String id, Object arg) throws XMLStreamException { EntityDecl ed = (EntityDecl) mConfig.findCustomInternalEntity(id); if (ed == null && mGeneralEntities != null) { ed = (EntityDecl) mGeneralEntities.get(id); } /* 05-Mar-2006, TSa: Externally declared entities are illegal * if we were declared as "standalone='yes'"... */ if (mDocStandalone == DOC_STANDALONE_YES) { if (ed != null && ed.wasDeclaredExternally()) { throwParseError(ErrorConsts.ERR_WF_ENTITY_EXT_DECLARED, ed.getName(), null); } } return ed; }
public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public final int getReplacementTextLength() { String str = getReplacementText(); return (str == null) ? 0 : str.length(); }
protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent) throws XMLStreamException { if (ent == null) { rep.reportValidationProblem("Referenced entity '"+id+"' not defined"); } else if (ent.isParsed()) { rep.reportValidationProblem("Referenced entity '"+id+"' is not an unparsed entity"); } }
protected EntityDecl findEntity(String id, Object arg) throws XMLStreamException { EntityDecl ed = null; if (mCustomEntities != null) { ed = (EntityDecl) mCustomEntities.get(id); } if (ed == null && mGeneralEntities != null) { ed = (EntityDecl) mGeneralEntities.get(id); } /* 05-Mar-2006, TSa: Externally declared entities are illegal * if we were declared as "standalone='yes'"... */ if (mDocStandalone == DOC_STANDALONE_YES) { if (ed != null && ed.wasDeclaredExternally()) { throwParseError(ErrorConsts.ERR_WF_ENTITY_EXT_DECLARED, ed.getName()); } } return ed; }
public String getText() { if (((1 << mCurrToken) & MASK_GET_TEXT) == 0) { throwNotTextual(mCurrToken); } if (mTokenState < mStTextThreshold) { safeFinishToken(); } if (mCurrToken == ENTITY_REFERENCE) { return (mCurrEntity == null) ? null : mCurrEntity.getReplacementText(); } if (mCurrToken == DTD) { /* 16-Aug-2004, TSa: Hmmh. Specs are bit ambiguous on whether this * should return just the internal subset, or the whole * thing... */ return getDTDInternalSubset(); } return mTextBuffer.contentsAsString(); }
protected EntityDecl findEntityDecl(DTDValidatorBase v, char[] ch, int start, int len, int hash) throws XMLStreamException { Map entMap = v.getEntityMap(); /* !!! 13-Nov-2005, TSa: If this was to become a bottle-neck, we * could use/share a symbol table. Or at least reuse Strings... */ String id = new String(ch, start, len); EntityDecl ent = (EntityDecl) entMap.get(id); if (ent == null) { reportValidationProblem(v, "Referenced entity '"+id+"' not defined"); } else if (ent.isParsed()) { reportValidationProblem(v, "Referenced entity '"+id+"' is not an unparsed entity"); } return ent; }
ent.markAsExternallyDeclared(); EntityDecl oldED = (EntityDecl) old; String str = " entity '"+id+"' defined more than once: first declaration at " + oldED.getLocation(); if (isParam) { str = "Parameter" + str; if (ent.isParsed()) { // Parsed GE or PE } else { // unparsed GE final URL src; throw new WstxIOException(e); mEventListener.dtdUnparsedEntityDecl(id, ent.getPublicId(), ent.getSystemId(), ent.getNotationName(), src);
throws IOException, XMLStreamException String id = ed.getName(); if (!ed.isParsed()) { throwParseError("Illegal reference to unparsed external entity '" +id+"'."); boolean isExt = ed.isExternal(); if (isExt) { if (!allowExt) { // never ok in attribute value... WstxInputSource newInput = null; try { newInput = ed.expand(oldInput, mEntityResolver, mConfig, mDocXmlVersion); } catch (FileNotFoundException fex) {
protected EntityDecl findEntity(String id, Object arg) throws XMLStreamException { EntityDecl ed = null; if (mCustomEntities != null) { ed = (EntityDecl) mCustomEntities.get(id); } if (ed == null && mGeneralEntities != null) { ed = (EntityDecl) mGeneralEntities.get(id); } /* 05-Mar-2006, TSa: Externally declared entities are illegal * if we were declared as "standalone='yes'"... */ if (mDocStandalone == DOC_STANDALONE_YES) { if (ed != null && ed.wasDeclaredExternally()) { throwParseError(ErrorConsts.ERR_WF_ENTITY_EXT_DECLARED, ed.getName()); } } return ed; }
return normalize ? ent.getName() : null;
public final int getReplacementTextLength() { String str = getReplacementText(); return (str == null) ? 0 : str.length(); }
protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent) throws XMLValidationException { if (ent == null) { rep.reportValidationProblem("Referenced entity '"+id+"' not defined"); } else if (ent.isParsed()) { rep.reportValidationProblem("Referenced entity '"+id+"' is not an unparsed entity"); } }
public char[] getTextCharacters() { if (((1 << mCurrToken) & MASK_GET_TEXT_XXX) == 0) { throwNotTextXxx(mCurrToken); } if (mTokenState < mStTextThreshold) { safeFinishToken(); } if (mCurrToken == ENTITY_REFERENCE) { return mCurrEntity.getReplacementChars(); } if (mCurrToken == DTD) { return getDTDInternalSubsetArray(); } return mTextBuffer.getTextBuffer(); }
ent.markAsExternallyDeclared(); EntityDecl oldED = (EntityDecl) old; String str = " entity '"+id+"' defined more than once: first declaration at " + oldED.getLocation(); if (isParam) { str = "Parameter" + str; if (ent.isParsed()) { // Parsed GE or PE } else { // unparsed GE mEventListener.dtdUnparsedEntityDecl(id, ent.getPublicId(), ent.getSystemId(), ent.getNotationName(), mInput.getSource());
throws IOException, XMLStreamException String id = ed.getName(); if (!ed.isParsed()) { throwParseError("Illegal reference to unparsed external entity '" +id+"'."); boolean isExt = ed.isExternal(); if (isExt) { if (!allowExt) { // never ok in attribute value... WstxInputSource newInput = null; try { newInput = ed.expand(oldInput, mEntityResolver, mConfig, mDocXmlVersion); } catch (FileNotFoundException fex) {