xsl-list
[Top] [All Lists]

select all answers belongs to one question from xml with xpath

2005-06-30 11:36:25
hi every one
i have a set of questions and for each question a  set of answers (4
answers )stored in xml file as each each answer has an attribute as a
reference to the question that it belogs to as following :
<ques>
<question id="q1">
<text>a question</text>
</question>

<question id="q2">
<text>a question</text>
</question>

<question id="q3">
<text>a question</text>
</question>

</ques>

<ans>
<answer an_id="an1" question="q1">
<text>an answer</text>
</answer>

<answer an_id="an2" question="q1">
<text>an answer</text>
</answer>

<answer an_id="an3" question="q1">
<text>an answer</text>
</answer>

<answer an_id="an4" question="q1">
<text>an answer</text>
</answer>

<answer an_id="an5" question="q2">
<text>an answer</text>
</answer>

<answer an_id="an6" question="q2">
<text>an answer</text>
</answer>

<answer an_id="an7" question="q2">
<text>an answer</text>
</answer>


<answer an_id="an8" question="q2">
<text>an answer</text>
</answer>


<answer an_id="an5" question="q3">
<text>an answer</text>
</answer>
<answer an_id="an5" question="q3">
<text>an answer</text>
</answer>
<answer an_id="an5" question="q3">
<text>an answer</text>
</answer>
<answer an_id="an5" question="q3">
<text>an answer</text>
</answer>
</ans>


i am trying to write xpath which allows me to get all answers belongs to
one question along with the question that has the answers
i am get stuck

any help please

thanks





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>