XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 21st, 2009, 01:16 AM
ii72 ii72 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 3 ii72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 26 sec
Reputation Power: 0
ProgressBar + XSLT

Code:
Hi All,
As mentioned in my first post "Create href in XSLT"
I have a XML file which i am transfering to XHTML using XSLT.

One of the nodes in the XML named:"coverage"

after transforming it to XHTML i represent it in a table.
Is there a way to create a progress bar with the coverage node data?  - like if i am in 25% quarter of the bar will be filled.(and a color will be red)
but if 50% appear in the coverage node then half of the bar will be fill and the color will be change to yellow.

Bellow XML example and XSLT file (copy paste to same folder you can see the result)

Thank you from advance for any help you may supply
i.i

XML:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="Style2.xslt"?>
<projects_page>
  <project_name name="V5R20">
    <status>NoGo</status>
    <Plan>20</Plan>
    <coverage>12</coverage>
    <duedate>48</duedate>
    <Mand>10</Mand>
    <MF>11</MF>
    <P1_Reg>12</P1_Reg>
<projectLink>http://.....</projectLink>
  </project_name>
  <project_name name="V5R19 SP5">
    <status>NoGo</status>
    <Plan>70</Plan>
    <coverage>50</coverage>
    <duedate>30</duedate>
    <Mand>10</Mand>
    <MF>11</MF>
    <P1_Reg>12</P1_Reg>
    <projectLink>http://...</projectLink>
  </project_name>
</projects_page>


XSLT:


<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
  <xsl:template match="/">

    <html>
      <body>
        <table border="0" width="800" cellpadding="10">
          <tr>
            <td width="30">
              <img src="QA_Pic.jpg" id="pic1" />
            </td>
            <td width ="770" align="center">
              <font size="30" color="CornflowerBlue">
                <MARQUEE direction="letf">Running Projects in QA</MARQUEE>
              </font>
            </td>
          </tr>
          <tr>
            <td colspan="2">
              <table width="100%" hight="50%" border="0" align="Left" cellspacing="5">
                <tr border="1">
                  <th  width="5%"></th>
                  <th width="10%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">Project Name</font>
                  </th>
                  <th width="40%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">Status And Coverage</font>
                  </th>
                  <th width="10%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">Mand.</font>
                  </th>
                  <th width="10%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">MF</font>
                  </th>
                  <th width="10%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">P1 Reg.</font>
                  </th>
                  <th width="10%">
                    <font size="3" color="CornflowerBlue" face="Tahoma">GD</font>
                  </th>
                </tr>
                <xsl:for-each select="projects_page/project_name">
                  <tr align="center">
                    <td width="70">
                      <img src="http:...></img>
                    </td>
                    <td width="100" align="center">
                      <font size="3" color="CornflowerBlue" face="Tahoma">
                      <a> 
                      <xsl:attribute name="href">
                        <xsl:value-of select="projectLink"/>
                      </xsl:attribute>
                      <xsl:value-of select="@name"/>
                        </a>
                      </font>
                    </td>
                    
                    <td width="350">
                      
                      <xsl:choose>
                        <xsl:when test="status='GO'">
                          <xsl:attribute name="bgcolor">LimeGreen</xsl:attribute>
                        </xsl:when>
                        <xsl:when test="status='GO IF'">
                          <xsl:attribute name="bgcolor">yellow</xsl:attribute>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:attribute name="bgcolor">red</xsl:attribute>
                        </xsl:otherwise>
                      </xsl:choose>
                      <font size="3" color="black" face="Tahoma">Plan
                        <xsl:value-of select="Plan"/>% Vs.
                      </font>
                      <font size="3" color="black" face="Tahoma">Actual
                        <xsl:value-of select="coverage"/>%
                      </font>
                      </td>
                    <td width="70" align="center">
                      <font size="3" color="black" face="Tahoma">
                      <xsl:value-of select="Mand"/>
                      </font>
                    </td>
                    <td width="70" align="center">
                      <font size="3" color="black" face="Tahoma">
                        <xsl:value-of select="MF"/>
                      </font>
                    </td>
                    <td width="70" align="center">
                      <font size="3" color="black" face="Tahoma">
                        <xsl:value-of select="P1_Reg"/>
                      </font>
                    </td>
                    <td width="70" align="center">WK
                      <font size="3" color="black" face="Tahoma">
                      <xsl:value-of select="duedate"/>
                      </font>
                    </td>
                  </tr>
                </xsl:for-each>
                <tr>
                  <td align="center" border="0">
                    <a href="http:....">
                      <img src="....."0"></img>
                    </a>
                  </td>
                  <td align="left" border="0">
                    <a href="...">
                    <img src="...."0"></img>
                      </a>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Reply With Quote
  #2  
Old June 21st, 2009, 05:30 AM
xml-profi xml-profi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 120 xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level)xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level)xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level)xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level)xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level)xml-profi User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 53 sec
Reputation Power: 44
Send a message via ICQ to xml-profi
use xsl:for-each for nodeset

Code:

<?xml version="1.0" encoding="UTF-8" ?>



<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes"/>	
	<xsl:template match="/">		
                <html>		
		<xsl:apply-templates select="projects_page"/>
		</html>
	</xsl:template>
	<xsl:template match="projects_page">
	<body>
	<table>	
	<xsl:apply-templates select="project_name"/>
	</table>	
	</body>	
	</xsl:template>
	<xsl:template match="project_name">
	<tr>
	<xsl:apply-templates select="status"/>
	<xsl:apply-templates select="Plan"/>
	<xsl:apply-templates select="projectLink"/>
	</tr>	
	</xsl:template>	
	<xsl:template match="status">
	<td>
	<xsl:value-of select="."/>
	</td>
	</xsl:template>
	<xsl:template match="Plan">
	<td>
	<xsl:value-of select="."/>
	</td>
	</xsl:template>
	<xsl:template match="projectLink">
	<td>
	<a>
	<xsl:attribute name="href">
	<xsl:value-of select="."/>
	</xsl:attribute>
	gdfasf
	</a>	
	</td>
	</xsl:template>	
</xsl:stylesheet>




Code:

<?xml version="1.0" encoding="utf-8"?>
<html>
   <body>
      <table>
         <tr>
            <td>NoGo</td>
            <td>20</td>
            <td>
               <a href="http://.....">
	gdfasf
	</a>
            </td>
         </tr>
         <tr>
            <td>NoGo</td>
            <td>70</td>
            <td>
               <a href="http://...">
	gdfasf
	</a>
            </td>
         </tr>
      </table>
   </body>
</html>



use css display html

http://www.css4you.de/
__________________
Helmut Hagemann Germany

wer lesen und google kann ist klar im Vorteil
who can read and google is a clear advantage

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > ProgressBar + XSLT


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek