/** * Error handling code shared between the various getSchemaDocument() methods. */ private Element getSchemaDocument1(boolean mustResolve, boolean hasInput, XMLInputSource schemaSource, Element referElement, IOException ioe) { // either an error occured (exception), or empty input source was // returned, we need to report an error or a warning if (mustResolve) { if (hasInput) { reportSchemaError("schema_reference.4", new Object[]{schemaSource.getSystemId()}, referElement, ioe); } else { reportSchemaError("schema_reference.4", new Object[]{schemaSource == null ? "" : schemaSource.getSystemId()}, referElement, ioe); } } else if (hasInput) { reportSchemaWarning("schema_reference.4", new Object[]{schemaSource.getSystemId()}, referElement, ioe); } fLastSchemaWasDuplicate = false; return null; } // getSchemaDocument1(boolean, boolean, XMLInputSource, Element): Element
public XMLDTDDescription(XMLInputSource source) { this.setValues(source.getPublicId(), null, source.getBaseSystemId(), source.getSystemId()); this.fRootName = null; this.fPossibleRoots = null; } // init(XMLInputSource)
is = new XMLInputSource(publicId, referringSchemaInputSource.getSystemId() + INLINE_SCHEMA_ID, null, new StringReader(schema),null);
/** * Pushes an input source onto the current entity stack. This enables the scanner to * transparently scan new content (e.g. the output written by an embedded script). At the end of * the current entity, the scanner returns where it left off at the time this entity source was * pushed. * <p> * <strong>Note:</strong> This functionality is experimental at this time and is subject to * change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This enables the scanner to * transparently scan new content (e.g. the output written by an embedded script). At the end of * the current entity, the scanner returns where it left off at the time this entity source was * pushed. * <p> * <strong>Note:</strong> This functionality is experimental at this time and is subject to * change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); final String encoding = inputSource.getEncoding(); final String publicId = inputSource.getPublicId(); final String baseSystemId = inputSource.getBaseSystemId(); final String literalSystemId = inputSource.getSystemId(); final String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); }
/** * Pushes an input source onto the current entity stack. This * enables the scanner to transparently scan new content (e.g. * the output written by an embedded script). At the end of the * current entity, the scanner returns where it left off at the * time this entity source was pushed. * <p> * <strong>Note:</strong> * This functionality is experimental at this time and is * subject to change in future releases of NekoHTML. * * @param inputSource The new input source to start scanning. * @see #evaluateInputSource(XMLInputSource) */ public void pushInputSource(XMLInputSource inputSource) { final Reader reader = getReader(inputSource); fCurrentEntityStack.push(fCurrentEntity); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); } // pushInputSource(XMLInputSource)
XSDDatatype definedType = new XSDGenericType(xstype, source.getSystemId()); tm.registerDatatype(definedType); names.add(definedType.getURI());
@Override public void resolve(Identifier id, Input input) throws IOException, ResolverException { if(fResolver != null) { String expanded = id.getUriReference(); //Compute the expanded system ID try { expanded = new URL(new URL(id.getBase()), id.getUriReference()).toString(); } catch (Exception e) { } XMLResourceIdentifier identifier = new XMLResourceIdentifierImpl( null, id.getUriReference(), id.getBase(), expanded); XMLInputSource resolved = fResolver.resolveEntity(identifier); if(resolved != null) { input.setUri(resolved.getSystemId()); input.setByteStream(resolved.getByteStream()); input.setCharacterStream(resolved.getCharacterStream()); input.setEncoding(resolved.getEncoding()); } else { //Just set the URI //input.setUri(expanded); } } } /**
desc.fContextType = XSDDescription.CONTEXT_PREPARSE; desc.setBaseSystemId(source.getBaseSystemId()); desc.setLiteralSystemId( source.getSystemId());
reset(); String eid = XMLEntityManager.expandSystemId(source.getSystemId(), source.getBaseSystemId(), fStrictURI); XMLDTDDescription desc = new XMLDTDDescription(source.getPublicId(), source.getSystemId(), source.getBaseSystemId(), eid, null); if (!fBalanceSyntaxTrees) { fDTDGrammar = new DTDGrammar(fSymbolTable, desc);
String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId,
String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding,
final String publicId = inputSource.getPublicId(); final String baseSystemId = inputSource.getBaseSystemId(); final String literalSystemId = inputSource.getSystemId(); final String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding,
String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding,
String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId,
fDoctypeName = fElementQName.rawname; fDoctypePublicId = src.getPublicId(); fDoctypeSystemId = src.getSystemId();
public LSInput resolveResource(String type,String ns, String publicId, String systemId, String baseUri) { if(fEntityResolver==null) return null; try { XMLInputSource is = fEntityResolver.resolveEntity( new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null)); if(is==null) return null; LSInput di = new DOMInputImpl(); di.setBaseURI(is.getBaseSystemId()); di.setByteStream(is.getByteStream()); di.setCharacterStream(is.getCharacterStream()); di.setEncoding(is.getEncoding()); di.setPublicId(is.getPublicId()); di.setSystemId(is.getSystemId()); return di; } catch( IOException e ) { // erors thrown by the callback is not supposed to be // reported to users. throw new XNIException(e); } } });
fDocumentHandler.doctypeDecl(fDoctypeName, fExternalSubsetSource.getPublicId(), fExternalSubsetSource.getSystemId(), null);