fSchemaValidator.setDocumentHandler(null); return; fDOMValidatorHandler = fDOMResultAugmentor; fDOMResultAugmentor.setDOMResult(result); fSchemaValidator.setDocumentHandler(fDOMResultAugmentor); return; fSchemaValidator.setDocumentHandler(fDOMResultBuilder);
/** * Sets up handler for <code>StAXResult</code>. */ private void setupStAXResultHandler(StAXResult result) { // If there's no StAXResult, unset the validator handler if (result == null) { fStAXValidatorHandler = null; fSchemaValidator.setDocumentHandler(null); return; } XMLStreamWriter writer = result.getXMLStreamWriter(); if (writer != null) { if (fStAXStreamResultBuilder == null) { fStAXStreamResultBuilder = new StAXStreamResultBuilder(fNamespaceContext); } fStAXValidatorHandler = fStAXStreamResultBuilder; fStAXStreamResultBuilder.setStAXResult(result); } else { if (fStAXEventResultBuilder == null) { fStAXEventResultBuilder = new StAXEventResultBuilder(this, fNamespaceContext); } fStAXValidatorHandler = fStAXEventResultBuilder; fStAXEventResultBuilder.setStAXResult(result); } fSchemaValidator.setDocumentHandler(fStAXValidatorHandler); }
public void startDocument() throws SAXException { fComponentManager.reset(); fSchemaValidator.setDocumentHandler(this); fValidationManager.setEntityState(this); fTypeInfoProvider.finishStartElement(); // cleans up TypeInfoProvider fNeedPushNSContext = true; if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) { // should only clear this if the last document contained unparsed entities fUnparsedEntities.clear(); } fErrorReporter.setDocumentLocator(fSAXLocatorWrapper); try { fSchemaValidator.startDocument(fSAXLocatorWrapper, fSAXLocatorWrapper.getEncoding(), fNamespaceContext, null); } catch (XMLParseException e) { throw Util.toSAXParseException(e); } catch (XNIException e) { throw Util.toSAXException(e); } }
/** Configures the pipeline. */ protected void configurePipeline() { super.configurePipeline(); if ( getFeature(XMLSCHEMA_VALIDATION )) { // If schema validator was not in the pipeline insert it. if (fSchemaValidator == null) { fSchemaValidator = new XMLSchemaValidator(); // add schema component fProperties.put(SCHEMA_VALIDATOR, fSchemaValidator); addComponent(fSchemaValidator); // add schema message formatter if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) { XSMessageFormatter xmft = new XSMessageFormatter(); fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft); } } fLastComponent = fSchemaValidator; fNamespaceBinder.setDocumentHandler(fSchemaValidator); fSchemaValidator.setDocumentHandler(fDocumentHandler); fSchemaValidator.setDocumentSource(fNamespaceBinder); } } // configurePipeline()
fSchemaValidator.setDocumentHandler(parser); parser.setContentHandler(ser.asContentHandler()); fSchemaValidator.setDocumentHandler(null); fSchemaValidator.setDocumentHandler(null);
fSchemaValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fSchemaValidator);
fSchemaValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fSchemaValidator);
fSchemaValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fSchemaValidator);