question: int findAncestor ( XPathContext xctxt , XPath fromMatchPattern , XPath countMatchPattern , int context , ElemNumber namespaceContext ) throws javax . xml . transform . TransformerException { DTM dtm = xctxt . getDTM ( context ) ; while ( DTM . NULL != context ) { if ( null != fromMatchPattern ) { if ( fromMatchPattern . getMatchScore ( xctxt , context ) != XPath . MATCH_SCORE_NONE ) { break ; } } if ( null != countMatchPattern ) { if ( countMatchPattern . getMatchScore ( xctxt , context ) != XPath . MATCH_SCORE_NONE ) { break ; } } context = dtm . getParent ( context ) ; } return context ; }
target:  Given a 'from' pattern (ala xsl:number), a match pattern and a context, find the first ancestor that matches the pattern (including the context handed in).