Project

Profile

Help

How to connect?
Download (723 Bytes) Statistics
| Branch: | Revision:

he / src / main / c / samples / cppTests / q12.xsl @ 0c4104cf

1
<result xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0">
2
  <!-- Q12.   For each richer-than-average person, list the number of items 
3
      currently on sale whose price does not exceed 0.02% of the 
4
       person's income. -->
5
  
6
  
7

    
8
  <xsl:for-each select="doc('xmark100k.xml')/site/people/person">
9

    
10
    <xsl:variable name="p" select="." as="element(person)"/>
11

    
12
    <xsl:variable name="l" as="element(initial)*" select="doc('xmark100k.xml')/site/open_auctions/open_auction/initial[$p/profile/@income > (5000 * .)]" />  
13

    
14
    <xsl:if test="$p/profile/@income > 50000">
15
        <item person="{name}">
16
         <xsl:value-of select="count($l)"/>
17
        </item>
18
    </xsl:if>
19
  </xsl:for-each>
20

    
21
</result>
(19-19/28)