/** <p>Handles xs:include.</p>
*/
protected void includeSchema(XsESchema pIncludingSchema,
XsEInclude pInclude)
throws SAXException, IOException, ParserConfigurationException {
XsAnyURI schemaLocation = pInclude.getSchemaLocation();
if (schemaLocation == null) {
throw new LocSAXException("Invalid include: Missing 'schemaLocation' attribute.",
pInclude.getLocator());
}
Locator locator = pInclude.getLocator();
InputSource schemaSource = getInputSource(locator == null ? null : locator.getSystemId(),
schemaLocation.toString());
XsESchema includedSchema = parseSyntax(schemaSource);
XsAnyURI incNamespace = includedSchema.getTargetNamespace();
if (incNamespace == null) {
includedSchema.setTargetNamespace(includedSchema.getTargetNamespace());
} else {
XsAnyURI myNamespace = includedSchema.getTargetNamespace();
if (!incNamespace.equals(myNamespace)) {
throw new LocSAXException("Invalid include: The included schemas target namespace " +
incNamespace + " and the including schemas target namespace " +
myNamespace + " do not match.",
pInclude.getLocator());