Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8534821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:17:06+00:00 2026-06-11T10:17:06+00:00

i wrote code in xslt to convert xml file to html file. that html

  • 0

i wrote code in xslt to convert xml file to html file. that html file contains tables(approximately 10 tables), and now

my requirement is i need to display how many times the words such as “action”,”trace”,”verification” occured in the table. i managed to do with the jquery

the link for jsfiddle to see my work is: http://jsfiddle.net/trinathguptha89/s3Ppq/1/

i need to know is there any way arround i can do that with either xslt or javascript alone

and my xslt code is:

 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Report/Scripts">
<html>
   <head>
   <title>Mobiuss.rtp Test Execution Results</title>
   <script type="text/javascript" src="jquery.js"></script>
   <style>
   .sortable {table-layout: fixed; width:100%; height:25px; border:1px solid #ccc; background-color:#8B7D7B}
   .sortable th {padding:4px 6px 6px; background:#444; color:#fff; text-align:center; color:#ccc}
   .sortable td {padding:2px 4px 4px; background:#fff; border-bottom:1px solid #ccc;}
   .sortable tr {text-overflow:scroll}
   .sortable tr:hover {color:#FFB90F}
   </style>
   </head>
   <body>
   <xsl:for-each select="Script">
   <h1><xsl:value-of select="@File"/></h1>
    Execution log
   <br>
   </br>
   <div></div>
   <table class="sortable">
   <tr>
   <th>Time</th>
   <th>Position</th>
   <th>Type</th>
   <th>Message</th>
   </tr>
   <xsl:for-each select="Message">
   <tr>
   <td> <xsl:value-of select="@Time"/></td>
   <td>Line <xsl:value-of select="@Line"/></td>
   <td> <xsl:value-of select="@Type"/></td>
   <td> <xsl:value-of select="@Message"/></td>
   </tr>
   </xsl:for-each>
   </table>
   </xsl:for-each>       
   </body>
   </html>   
</xsl:template>
 </xsl:stylesheet>

and the table formed out of the above code can be seen in the jsfiddle link i gave above

My xml file goes here

 <?xml version="1.0" encoding="utf-8"?>
 <Report App="RIATest" Version="4.7" Project="D:\Projects\Automation\RIATest\Nomura\Nomura.rtp">
  <Startup>
  <Message Time="2012-08-30 15:32:38.578" Type="Info" Message="Launching iexplore.exe &quot;http://mobiuss-dev.operasolutions.com:8080/nomura-test/&quot;"/>
  <Message Time="2012-08-30 15:32:38.625" Type="Info" Message="Application launched (process id=4108)."/>
  <Message Time="2012-08-30 15:32:38.625" Type="Info" Message="Waiting for connection from agent..."/>
  <Message Time="2012-08-30 15:32:46.453" Type="Info" Message="Agent connection accepted. Application id=nomura-ui, index=0"/>
</Startup>
<Scripts>
<Script File="Login.rts" Time="2012-08-30 15:32:46.468">
  <Message Time="2012-08-30 15:32:46.531" Type="Verification" Line="8" Col="58"  Message="Verification passed: SparkApplication(&quot;nomura-ui&quot;)=&gt;visible is equal to true"/>
  <Message Time="2012-08-30 15:32:46.578" Type="Verification" Line="10" Col="50" Message="Verification passed: FlexForm(&quot;loginForm&quot;)=&gt;visible is equal to true"/>
  <Message Time="2012-08-30 15:32:46.625" Type="Verification" Line="12" Col="65" Message="Verification passed: FlexLabel(&quot;Username::Username:&quot;)=&gt;text is equal to &quot;Username:&quot;"/>
  <Message Time="2012-08-30 15:32:46.656" Type="Verification" Line="14" Col="65" Message="Verification passed: FlexLabel(&quot;Password::Password:&quot;)=&gt;text is equal to &quot;Password:&quot;"/>
  <Message Time="2012-08-30 15:32:46.671" Type="Verification" Line="17" Col="39" Message="Verification passed: comp=&gt;label is equal to &quot;Log In&quot;"/>
  <Message Time="2012-08-30 15:32:46.703" Type="Verification" Line="18" Col="35" Message="Verification passed: comp=&gt;enabled is equal to true"/>
  <Message Time="2012-08-30 15:32:46.718" Type="Verification" Line="19" Col="35" Message="Verification passed: comp=&gt;visible is equal to true"/>
  <Message Time="2012-08-30 15:32:46.734" Type="Verification" Line="22" Col="35" Message="Verification passed: comp=&gt;enabled is equal to true"/>
  <Message Time="2012-08-30 15:32:46.750" Type="Verification" Line="23" Col="54" Message="Verification passed: comp=&gt;label is equal to &quot;Forgot your password?&quot;"/>
  <Message Time="2012-08-30 15:32:46.765" Type="Verification" Line="24" Col="36" Message="Verification passed: comp=&gt;selected is equal to false"/>
  <Message Time="2012-08-30 15:32:46.781" Type="Verification" Line="25" Col="35" Message="Verification passed: comp=&gt;visible is equal to true"/>
  <Message Time="2012-08-30 15:32:46.796" Type="Verification" Line="28" Col="61" Message="Verification passed: comp=&gt;text is equal to &quot;CORPORATE BOND SPREAD SIGNAL&quot;"/>
  <Message Time="2012-08-30 15:32:46.812" Type="Verification" Line="29" Col="35" Message="Verification passed: comp=&gt;visible is equal to true"/>
  <Message Time="2012-08-30 15:32:46.906" Type="Action" Line="32" Col="64" Message="SparkTextInput(&quot;Username::userName&quot;)=&gt;textSelectionChange(0,0)"/>
  <Message Time="2012-08-30 15:32:47.000" Type="Action" Line="33" Col="63" Message="SparkTextInput(&quot;Username::userName&quot;)=&gt;textInput(&quot;arun.sekar&quot;)"/>
  <Message Time="2012-08-30 15:32:47.031" Type="Action" Line="35" Col="61" Message="SparkTextInput(&quot;Password::password&quot;)=&gt;textInput(&quot;opera100&quot;)"/>
  <Message Time="2012-08-30 15:32:47.093" Type="Action" Line="36" Col="32" Message="SparkButton(&quot;Log In&quot;)=&gt;click()"/>
  </Script>
 </Scripts>
 <Results>
<Summary scripts="2" time="8.515" errors="2"/>
<Script name="Login.rts" time="0.625" errors="0"/>
<Script name="NOM_0002.rts" time="50.000" errors="2" message="Verification failed: comp=&gt;selected is not equal to expected value true, it is actually equal to false"/>
 </Results>
</Report>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:17:08+00:00Added an answer on June 11, 2026 at 10:17 am

    You can do this easily in xslt

    example all of Action Type:

    <xsl:value-of select="count(Script/Message[@Type='Action'])"/>
    

    example of each table:

    <xsl:for-each select="Script">
        Table - <xsl:value-of select="position()"/>
        <xsl:value-of select="count(Message[@Type='Action'])"/>
    </xsl:for-each>
    

    for row colors you can use this:

    <xsl:variable name="Colour">
    <xsl:choose>
      <xsl:when test="contains(@message,'Verification failed:')">background-color:red;</xsl:when>
      <xsl:when test="contains(@message,'Verification passed:')">background-color:green</xsl:when>
      <xsl:otherwise> </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    
     <tr style="{$Colour}">
       <td> <xsl:value-of select="@Time"/></td>
       <td>Line <xsl:value-of select="@Line"/></td>
       <td> <xsl:value-of select="@Type"/></td>
       <td> <xsl:value-of select="@Message"/></td>
     </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write an XSLT that organizes an HTML file into different section
i wrote code to display any type of file like pdf,svg,etc.But unfortunately my code
I'd like to transform a string that contains an xml using a XSLT, it's
Situation: I have a simple XML document that contains image information. I need to
I have an HTML file and i want to convert to XML document only
My application produces an xml file that is then xslt transformed into a nice
I recently wrote code that didnt work as i would expect, it was: message
I wrote some code in VHDL that is expected to look at a rotory
I wrote some code that activity starts a service to get some text from
I am very new to XSLT, and the first thing that i need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.