Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSL Test expression: please help XSL Test expression: please helpTo: NULL Date: 7/6/2006 8:57:00 PM
I have some XML representing survey questions and answers, along with
"trigger" definitions that represent a signal for when certain
questions should be displayed. Here's a stripped down example:
<Question>
<QuestionID>1</QuestionID>
<CurrentValue>0</CurrentValue>
</Question>
<Question>
<QuestionID>2</QuestoinID>
<CurrentValue>1</CurrentValue>
</Question>
<Question>
<QuestionID>3</QuestionID>
<CurrentValue>0</CurrentValue>
</Question>
<Trigger>
<QuestionID>3</QuestionID>
<ParentQuestionID>1</ParentQuestionID>
<ParentValue>0</ParentValue>
</Trigger>
<Trigger>
<QuestionID>3</QuestionID>
<ParentQuestionID>2</ParentQuestionID>
<ParentValue>0</ParentValue>
</Trigger>
Basically, those triggers say that Question 3 should be displayed when
either Question 1 has a value of 0, or when Question 2 has a value of
0. I plan to loop through each question, then run a test expression
that will determine whether that particular question gets displayed.
First, the easy part:I test to see if there are no triggers for a
question, meaning that the question should always be displayed:
not(../Trigger[QuestionID = current()/QuestionID])
The other part is where I'm stuck: testing to see if any of the
triggers' conditions have been met. This is what I have so far:
or
../Question[QuestionID = ../Trigger[QuestionID =
current()/QuestionID]/ParentQuestionID]/CurrentValue =
../Trigger[QuestionID = current()/QuestionID]/ParentValue
However, that just compares the set of CurrentValues of ParentQuestions
with the set of ParentValues from the all the Trigger nodes.... but
doesn't correlate the ParentQuestion and ParentAnswers together...
Can anyone help me out in getting this expression to work?
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
