* @return Valid ElemTemplateElement, or throw a runtime exception
* if it is not found.
*/
protected ElemTemplateElement getElemFromExpression(Expression expr)
{
ExpressionNode parent = expr.exprGetParent();
while(null != parent)
{
if(parent instanceof ElemTemplateElement)
return (ElemTemplateElement)parent;
parent = parent.exprGetParent();
}
throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_NO_TEMPLATE_PARENT, null));
// "Programmer's error! expr has no ElemTemplateElement parent!");
}