Hi all. OK - what I've got is an XML file which I'm simplifying right here, so you can have a frame of reference:
<test>
<narrative id="1">Write True or False on the line.</narrative>
<narrative id="2">Write the answer using complete sentences.</narrative>
<question narrative_id="1">Is a dolphin a mammal?</question>
<question narrative_id="1">Is a worm alive?</question>
<question narrative_id="2">Why does heat rise? Be thorough.</question>
</test>
OK - here's what I'm having problems accomplishing... using an XSLT, I want to parse through the <question> tags and FIRST examine the narrative_id attribute. THEN, having identified the narrative_id attribute, I want to output the text within the <narrative> whose "id" attribute is the same as the "narrative_id" attribute in the <question> I just evaluated. THEN, having outputted that narrative, I want to finish by outputting the text in the <question> tag.
I've been able to output the text with each instance of <question>, AND I've been able to identify the "narrative_id" attribute of each instance of question, but I'm having trouble being able to fetch the value of the correct <narrative> when I need it.
Is this possible using XSLT? Can anyone offer some advice?
Thank you much,
Jeff
<test>
<narrative id="1">Write True or False on the line.</narrative>
<narrative id="2">Write the answer using complete sentences.</narrative>
<question narrative_id="1">Is a dolphin a mammal?</question>
<question narrative_id="1">Is a worm alive?</question>
<question narrative_id="2">Why does heat rise? Be thorough.</question>
</test>
OK - here's what I'm having problems accomplishing... using an XSLT, I want to parse through the <question> tags and FIRST examine the narrative_id attribute. THEN, having identified the narrative_id attribute, I want to output the text within the <narrative> whose "id" attribute is the same as the "narrative_id" attribute in the <question> I just evaluated. THEN, having outputted that narrative, I want to finish by outputting the text in the <question> tag.
I've been able to output the text with each instance of <question>, AND I've been able to identify the "narrative_id" attribute of each instance of question, but I'm having trouble being able to fetch the value of the correct <narrative> when I need it.
Is this possible using XSLT? Can anyone offer some advice?
Thank you much,
Jeff