Comparisons in conditions

Task

Source document

<jobs>
  <job name="cut Screens" availableBudget="8">
    <work usedBudget="3">Conception</work>
    <work usedBudget="3">Implementation</work>
    <work usedBudget="2.5">Implementation</work>
  </job>

  <job name="build HTML-demonstration" availableBudget="6">
    <work usedBudget="1.5">Conception</work>
    <work usedBudget="2.5">Implementation</work>
    <work usedBudget="2">Implementation</work>
  </job>
  <job name="CMS implementation" availableBudget="12">
    <work usedBudget="1">Data model</work>
    <work usedBudget="4">Editor-Customizing</work>
    <work usedBudget="4">Transformations</work>
    <work usedBudget="2">QS</work>
  </job>
</jobs>

Challenge

Select all job elements with an exceeded budget (attribute “availableBudget”). Count the total number of used units (attribute “usedBudget”) of all work-elements of a job for this purpose.

Desired selection (XML-output)

  • <job name="cut Screens" availableBudget="8">
    • <work usedBudget="3">Conception</work>
    • <work usedBudget="3">Implementation</work>
    • <work usedBudget="2.5">Implementation</work>
  • </job>

Exercise

Your input

Eine Lösung wäre: Lösung