W3C home > Mailing lists > Public > www-forms@w3.org > October 2003

Skipping emty Nodes/SVGs

From: Bastian Mueller <dzbabi@web.de>
Date: Fri, 24 Oct 2003 10:05:39 +0200
Message-Id: <200310240805.h9O85dQ10156@mailgate5.cinetic.de>
To: www-forms@w3.org

Hi all,

I have an XML in that form:

<uppercomp>

       <fondname> Der Oberfond  </fondname>                                                 
                         <comp>
                                   <val>50</val>
                                   <sector>Automobile</sector>
                          </comp>

                          <comp>
                                    <val>8</val>
                                  <sector>Banks</sector>
                          </comp>
</uppercomp>

<uppercomp>

       <fondname> Der Unterfond  </fondname>                                                 
                         <comp>
                                   <val>35</val>
                                   <sector>Automobile</sector>
                          </comp>

                          <comp>
                                    <val>32</val>
                                  <sector>Chemicals</sector>
                          </comp>
</uppercomp>


Here is my XSL File:

 <xsl:template match="wsx">
  <svg width="600px" height="500px">


                <g id="bar">

        <xsl:for-each select="comp">
          <xsl:variable name="value" select="val"/>
<rect x="{position()*70}" y="-{$value*4.0}" height="{$value*4.0}" width="30" style="fill:black;">
   </rect>
          <text x="{position()*70 + 7.5}" y="0" style="font-family:arial">
            <xsl:value-of select="sector"/>
             </text>
        </xsl:for-each>
           
  </g>

    </svg>
  </xsl:template>
</xsl:transform>

It creates a SVG(as you see), but i want that it Creates 3(!) Bars (one for each sector, it is no problem that on Automobiles it is double):

Any Ideas?

Greetings 
Bastian
______________________________________________________________________________
Horoskop, Comics, VIPs, Wetter, Sport und Lotto im WEB.DE Screensaver1.2
Kostenlos downloaden: http://screensaver.web.de/?mc=021110
Received on Friday, 24 October 2003 04:32:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:56 GMT