}
// Javadoc inherited
public void startDocument() throws SAXException {
if (inDocument) {
fatalError(new XMLPipelineException(
"A nested startDocument event was recieved.", locator));
}
inDocument = true;
try {
if (locator != null) {
XMLPipelineContext pipelineContext = getPipelineContext();
// store the locator away in the XMLPipelineContext. The Locator
// is useful when reporting errors
pipelineContext.pushLocator(locator);
pipelineContext.pushBaseURI(locator.getSystemId());
} else if (!allowNullLocator) {
warning(new XMLPipelineException("The document does not " +
"have an associated Locator.", null));
}
} catch (MalformedURLException e) {
// report the fatal error down the pipeline
fatalError(new XMLPipelineException(
"Locators systemId is invalid " +
locator.getSystemId(),
locator, e));
}
}