Advertisement

07.05.2007 at 06:53AM PDT, ID: 22676777
[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!

8.2

Spliting values in two columns

Asked by ShaileshShinde in Extensible Stylesheet Language Transformation (XSLT)

Tags: , ,

Hello Expert,

URGENT!!!!

This query is related to existing accepted query...http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XSLT/Q_22666065.html

In my xml there is an attribute @name which contains file path...i have to split it into two columns as file name and file path...here is the xsl code from which i am getting file name as given by you...
So the output html contains filepath as one column and filename as another column...in <table id="tbl"

XSL CODE...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output indent="yes" method="html"/>
      <xsl:template match="/">
            <html>
                  <head/>
                  <xsl:element name="link">
                        <xsl:attribute name="rel">stylesheet</xsl:attribute>
                        <xsl:attribute name="type">text/css</xsl:attribute>
                        <xsl:attribute name="href">global.css</xsl:attribute>
                  </xsl:element>
                  <xsl:element name="link">
                        <xsl:attribute name="rel">stylesheet</xsl:attribute>
                        <xsl:attribute name="type">text/css</xsl:attribute>
                        <xsl:attribute name="href">netscape6.css</xsl:attribute>
                  </xsl:element>
                  <xsl:element name="script">
                        <xsl:attribute name="language">javascript</xsl:attribute>
                        <xsl:attribute name="src">tablefilter.js</xsl:attribute>
                  </xsl:element>
                  <body onLoad="attachFilter(document.getElementById('tbl'), 1)">
                        <h2>Missing Art  Report</h2>
                        <table width="600" border="0" cellpadding="2" bordercolor="#333333" bgcolor="#CCCCCC" style="font-family: verdana;">
                              <tbody>
                                    <tr bgcolor="#ffcc66">
                                          <th colspan="2" bgcolor="#FFFFFF" style="border-right: 1px solid silver; cursor: default; color: white; background-color: #336699;">
                                                <div align="left">Summary</div>
                                          </th>
                                    </tr>
                                    <tr>
                                          <td width="216" bgcolor="#FFFFFF">Component</td>
                                          <td width="289" bgcolor="#FFFFFF">
                                                <xsl:value-of select="//component"/>
                                          </td>
                                    </tr>
                                    <tr>
                                          <td bgcolor="#FFFFFF">Language</td>
                                          <td bgcolor="#FFFFFF">
                                                <xsl:value-of select="//language"/>
                                          </td>
                                    </tr>
                                    <tr>
                                          <td bgcolor="#FFFFFF">Missing Art Count </td>
                                          <td bgcolor="#FFFFFF">
                                                <xsl:value-of select="//missingartcount"/>
                                          </td>
                                    </tr>
                                    <tr>
                                          <td bgcolor="#FFFFFF">Total  Art Count </td>
                                          <td bgcolor="#FFFFFF">
                                                <xsl:value-of select="//totalartcount"/>
                                          </td>
                                    </tr>
                              </tbody>
                        </table>
                        <br/>
                        <xsl:apply-templates select="artreport"/>
                  </body>
            </html>
      </xsl:template>
      <xsl:template match="artreport">
            <table id="tbl" style="border: 1px solid silver; border-collapse: collapse;" cellspacing="0" width="60%">
                  <tbody>
                        <tr>
                              <th width="50%" bgcolor="#FFFFFF" style="border-right: 1px solid silver; cursor: default; color: white; background-color: #336699;">File path</th>
<th width="50%" bgcolor="#FFFFFF" style="border-right: 1px solid silver; cursor: default; color: white; background-color: #336699;">File Name</th>
                              <th bgcolor="#FFFFFF" style="border-right: 1px solid silver; cursor: default; color: white; background-color: #336699;">Missing Status</th>
                        </tr>
                        <xsl:apply-templates select="artfile"/>
                  </tbody>
            </table>
      </xsl:template>
      <xsl:template match="artfile">
            <tr>
                  <td style="border: 1px solid silver; cursor: default;">
                        <xsl:call-template name="getFileName">
                              <xsl:with-param name="str" select="@name"/>
                        </xsl:call-template>
                  </td>
                  <xsl:for-each select="*">
                        <xsl:choose>
                              <xsl:when test="*[text()!='']">
                                    <td/>
                              </xsl:when>
                              <xsl:otherwise>
                                    <td style="border: 1px solid silver; cursor: default;">
                                          <xsl:value-of select="."/>
                                    </td>
                              </xsl:otherwise>
                        </xsl:choose>
                  </xsl:for-each>
            </tr>
      </xsl:template>
      <xsl:template name="getFileName">
            <xsl:param name="str"/>
            <xsl:choose>
                  <xsl:when test="contains($str, '/')">
                        <xsl:call-template name="getFileName">
                              <xsl:with-param name="str" select="substring-after($str, '/')"/>
                        </xsl:call-template>
                  </xsl:when>
                  <xsl:otherwise>
                        <xsl:value-of select="$str"/>
                  </xsl:otherwise>
            </xsl:choose>
      </xsl:template>
</xsl:stylesheet>
 
XML...

<artreport>
      <summary>
            <component>Cannon-CUG</component>
            <language>German</language>
            <missingartcount>3</missingartcount>
            <totalartcount>3</totalartcount>
      </summary>
      <artfile name="/AIS/Adobe/testing/test0.png">
            <artstatus>found</artstatus>
      </artfile>
      <artfile name="/AIS/Adobe/testing/test1.png">
            <artstatus>missing</artstatus>
      </artfile>Start Free Trial
[+][-]07.05.2007 at 07:43AM PDT, ID: 19424418

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 05:39AM PDT, ID: 19444561

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 06:27AM PDT, ID: 19444937

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 06:45AM PDT, ID: 19445061

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 07:09AM PDT, ID: 19445256

View this solution now by starting your 7-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

Zone: Extensible Stylesheet Language Transformation (XSLT)
Tags: columns, two, table
Sign Up Now!
Solution Provided By: Gertone
Participating Experts: 2
Solution Grade: B
 
 
[+][-]07.09.2007 at 11:25PM PDT, ID: 19451031

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2007 at 11:37PM PDT, ID: 19451063

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 05:18AM PDT, ID: 19452692

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32