[xsl] New to XSLT: problem with Xpath & traversing ancestor axis

Subject: [xsl] New to XSLT: problem with Xpath & traversing ancestor axis
From: Sanjukta Mitra <sanmit27@xxxxxxxxx>
Date: Thu, 3 Feb 2005 13:44:01 -0800 (PST)

I am fairly new to XSLT and am having trouble figuring
out the XPath related to traversing the ancestor
axis.Can anyone help me out with this?


(The source document is a binomial XML decisiontree,
where each question has two answers and each answer
can lead to further questions or terminal nodes.) 

I am trying to accomplish the following steps:

1.traverse the ancestor axis from the current node and
select the first question node whose parent is an
answer node with attribute  @ans='yes'.Storing this
question node in parameter stop_question.

2.Defining the param Cnt that counts the number of
decisiontree_answer{ with attribute @ans='no'}nodes
preceding the current node and following the
stop_question node. I want the counting of answer
nodes to stop once the stop question is reached.

3.Applying a template to the decisiontree_answer node
with attribute @ans='no' that is the immediate child
of the stop_question node

Here goes the code:

<xsl:template match="enumerated_type_ptr">

<xsl:param name="stop_question"

<xsl:param name="Cnt"


<xsl:with-param name="X1"
<xsl:with-param name="Y1" select="($YT)-78"/>


Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 

Current Thread