// get the function type, making sure that it's really a correct
// Target function
String funcName = root.getAttributes().
getNamedItem("MatchId").getNodeValue();
FunctionFactory factory = FunctionFactory.getTargetInstance();
try {
URI funcId = new URI(funcName);
function = factory.createFunction(funcId);
} catch (URISyntaxException use) {
throw new ParsingException("Error parsing TargetMatch", use);
} catch (UnknownIdentifierException uie) {
throw new ParsingException("Unknown MatchId", uie);
} catch (FunctionTypeException fte) {
// try to create an abstract function
try {
URI funcId = new URI(funcName);
function = factory.createAbstractFunction(funcId, root);
} catch (Exception e) {
// any exception here is an error
throw new ParsingException("invalid abstract function", e);
}
}