/** Configures the pipeline. */ protected void configurePipeline() { if (fCurrentDVFactory != fDatatypeValidatorFactory) { fCurrentDVFactory = fDatatypeValidatorFactory; // use XML 1.0 datatype library setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory); } // setup DTD pipeline if (fCurrentDTDScanner != fDTDScanner) { fCurrentDTDScanner = fDTDScanner; setProperty(DTD_SCANNER, fCurrentDTDScanner); setProperty(DTD_PROCESSOR, fDTDProcessor); } fDTDScanner.setDTDHandler(fDTDProcessor); fDTDProcessor.setDTDSource(fDTDScanner); fDTDProcessor.setDTDHandler(fDTDHandler); if (fDTDHandler != null) { fDTDHandler.setDTDSource(fDTDProcessor); } fDTDScanner.setDTDContentModelHandler(fDTDProcessor); fDTDProcessor.setDTDContentModelSource(fDTDScanner); fDTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler); if (fDTDContentModelHandler != null) { fDTDContentModelHandler.setDTDContentModelSource(fDTDProcessor); } // setup document pipeline if (fFeatures.get(NAMESPACES) == Boolean.TRUE) { if (fCurrentScanner != fNamespaceScanner) { fCurrentScanner = fNamespaceScanner; setProperty(DOCUMENT_SCANNER, fNamespaceScanner); setProperty(DTD_VALIDATOR, fDTDValidator); } fNamespaceScanner.setDTDValidator(fDTDValidator); fNamespaceScanner.setDocumentHandler(fDTDValidator); fDTDValidator.setDocumentSource(fNamespaceScanner); fDTDValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fDTDValidator); } fLastComponent = fDTDValidator; } else { // create components if (fNonNSScanner == null) { fNonNSScanner = new XMLDocumentScannerImpl(); fNonNSDTDValidator = new XMLDTDValidator(); // add components addComponent((XMLComponent) fNonNSScanner); addComponent((XMLComponent) fNonNSDTDValidator); } if (fCurrentScanner != fNonNSScanner) { fCurrentScanner = fNonNSScanner; setProperty(DOCUMENT_SCANNER, fNonNSScanner); setProperty(DTD_VALIDATOR, fNonNSDTDValidator); } fNonNSScanner.setDocumentHandler(fNonNSDTDValidator); fNonNSDTDValidator.setDocumentSource(fNonNSScanner); fNonNSDTDValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fNonNSDTDValidator); } fLastComponent = fNonNSDTDValidator; } } // configurePipeline()
/** Configures the XML 1.1 pipeline. Note: this method also resets the new XML11 components. */ protected void configureXML11Pipeline() { if (fCurrentDVFactory != fXML11DatatypeFactory) { fCurrentDVFactory = fXML11DatatypeFactory; setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory); } if (fCurrentDTDScanner != fXML11DTDScanner) { fCurrentDTDScanner = fXML11DTDScanner; setProperty(DTD_SCANNER, fCurrentDTDScanner); setProperty(DTD_PROCESSOR, fXML11DTDProcessor); } fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor); fXML11DTDProcessor.setDTDSource(fXML11DTDScanner); fXML11DTDProcessor.setDTDHandler(fDTDHandler); if (fDTDHandler != null) { fDTDHandler.setDTDSource(fXML11DTDProcessor); } fXML11DTDScanner.setDTDContentModelHandler(fXML11DTDProcessor); fXML11DTDProcessor.setDTDContentModelSource(fXML11DTDScanner); fXML11DTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler); if (fDTDContentModelHandler != null) { fDTDContentModelHandler.setDTDContentModelSource(fXML11DTDProcessor); } // setup XML 1.1 document pipeline if (fFeatures.get(NAMESPACES) == Boolean.TRUE) { if (fCurrentScanner != fXML11NSDocScanner) { fCurrentScanner = fXML11NSDocScanner; setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner); setProperty(DTD_VALIDATOR, fXML11NSDTDValidator); } fXML11NSDocScanner.setDTDValidator(fXML11NSDTDValidator); fXML11NSDocScanner.setDocumentHandler(fXML11NSDTDValidator); fXML11NSDTDValidator.setDocumentSource(fXML11NSDocScanner); fXML11NSDTDValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fXML11NSDTDValidator); } fLastComponent = fXML11NSDTDValidator; } else { // create components if (fXML11DocScanner == null) { // non namespace document pipeline fXML11DocScanner = new XML11DocumentScannerImpl(); addXML11Component(fXML11DocScanner); fXML11DTDValidator = new XML11DTDValidator(); addXML11Component(fXML11DTDValidator); } if (fCurrentScanner != fXML11DocScanner) { fCurrentScanner = fXML11DocScanner; setProperty(DOCUMENT_SCANNER, fXML11DocScanner); setProperty(DTD_VALIDATOR, fXML11DTDValidator); } fXML11DocScanner.setDocumentHandler(fXML11DTDValidator); fXML11DTDValidator.setDocumentSource(fXML11DocScanner); fXML11DTDValidator.setDocumentHandler(fDocumentHandler); if (fDocumentHandler != null) { fDocumentHandler.setDocumentSource(fXML11DTDValidator); } fLastComponent = fXML11DTDValidator; } } // configureXML11Pipeline()