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!"); }
From an XPath expression component get the ElemTemplateElement owner .