[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

XSLT. IF statement, or something more powerful

Asked by silentz in Extensible Markup Language (XML), Extensible Stylesheet Language Transformation (XSLT)

Tags: count, statement, xslt, xsl

Hello all.

I'm using XSLT to display data from an xml file.
Here's a very simplified idea of the format of the XML file

<Practice>
   <PracticeName>Practice One</PracticeName>
   <Doctor>
      <sex>M</sex>
   </Doctor>
   <Doctor>
      <sex>F</sex>
   </Doctor>
</Practice>

So a practice can have one or more Doctors, each of which has a sex node. That sounds dirty :)

Anyway. I need to ONLY SHOW A PRACTICE IF IT HAS AT LEAST 1 FEMALE DOCTOR.

I can filter out the Male doctors in a practice, but if there are only male doctors, it still shows the PracticeName. I would like it to completely skip the practice if there are no Females.

Here's pseudocode for what i'm trying to do (and how i'd do it in vb)

for each Practice
   for each Doctor
      if sex = 'M' then foundmale = true
   next
   if foundmale = false then
      Print Practice
   end if
next

Comprendez?  I think either a) XSLT cant do what i'm trying to do in which case its crap. or more likely b) I just dont know enough XSLT.

Something along the lines of <xsl:if test="count(sex='M')>0">  is what i'm looking for. But that obviously doesnt work!

Any help is appreciated greatly.
[+][-]09/18/02 11:17 PM, ID: 7290469Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Extensible Markup Language (XML), Extensible Stylesheet Language Transformation (XSLT)
Tags: count, statement, xslt, xsl
Sign Up Now!
Solution Provided By: monas
Participating Experts: 2
Solution Grade: A
 
[+][-]09/18/02 08:04 AM, ID: 7288492Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/18/02 08:10 AM, ID: 7288516Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/18/02 08:32 AM, ID: 7288586Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/18/02 08:46 AM, ID: 7288627Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/18/02 09:43 AM, ID: 7288791Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/19/02 01:18 AM, ID: 7290665Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/19/02 01:49 AM, ID: 7290720Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93