}
InputStream in = null;
if ( uri != null ) {
in = context.getResourceAsStream( uri );
if ( in == null ) {
throw new JellyException( "Could not find resource for uri: " + uri );
}
}
else {
String text = getBodyText();
byte[] data = text.getBytes();
in = new ByteArrayInputStream( text.getBytes() );
}
Schema schema = null;
if (systemId != null) {
schema = factory.compileSchema(in, systemId);
}
else if ( uri != null ) {
schema = factory.compileSchema(in, uri);
}
else{
schema = factory.compileSchema(in);
}
if ( schema == null ) {
throw new JellyException( "Could not create a valid schema" );
}
Verifier verifier = schema.newVerifier();
context.setVariable(var, verifier);
}