if (namespace==null) {
namespace = "";
} else {
namespace = namespace.trim();
}
PreparedStylesheet preparedStylesheet = getPreparedStylesheet();
Configuration config = preparedStylesheet.getConfiguration();
if (!config.isSchemaAware(Configuration.XSLT)) {
compileError("To use xsl:import-schema, you need the schema-aware " +
"version of Saxon from http://www.saxonica.com/", "XTSE1650");
return;
}
AxisIterator kids = iterateAxis(Axis.CHILD);
NodeInfo inlineSchema = null;
while (true) {
Item child = kids.next();
if (child==null) {
break;
}
if (inlineSchema != null) {
compileError(getDisplayName() + " must not have more than one child element");
}
inlineSchema = (NodeInfo)child;
if (inlineSchema.getFingerprint() != StandardNames.XS_SCHEMA) {
compileError("The only child element permitted for " + getDisplayName() + " is xs:schema");
}
if (schemaLoc != null) {
compileError("The schema-location attribute must be absent if an inline schema is present");
}
namespace = config.readInlineSchema(inlineSchema, namespace, preparedStylesheet.getErrorListener());
getPrincipalStylesheet().addImportedSchema(namespace);
}
if (inlineSchema != null) {
return;
}