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

  • SEARCH
  • Home
  • 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 8480485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:18:26+00:00 2026-06-10T19:18:26+00:00

I used the below code to display a XML file as HTML using XSLT

  • 0

I used the below code to display a XML file as HTML using XSLT

<?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>
   <link rel="stylesheet" href="xmlstyle.css" />
   </head>
   <body>
   <xsl:for-each select="Script">
   <h1><xsl:value-of select="@File"/></h1>
   Execution log
   <br>
   </br>
   <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>

The above code displays the XML file as html it creates around 4 tables(depends on the XML)
But for some reason I don’t know the first table alone is following the CSS all other tables does not get styled.

The CSS code goes here:

@CHARSET "ISO-8859-1";
.sortable {width:100%; height:40px; border:1px solid #ccc; background-color:#EEE0E5}
.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; overflow:auto}
.sortable .head {background:#444 url(images/sort.gif) 6px center no-repeat; cursor:pointer; padding-left:18px}
.sortable .desc {background:#222 url(images/desc.gif) 6px center no-repeat; cursor:pointer; padding-left:18px}
.sortable .asc {background:#222 url(images/asc.gif) 6px  center no-repeat; cursor:pointer; padding-left:18px}
.sortable .head:hover, .sortable .desc:hover, .sortable .asc:hover {color:#fff}
.sortable .even td {background:#f2f2f2}
.sortable .odd td {background:#fff}

please guide me what to change in my code so that all the tables that gets created are properly styled.

  • 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-10T19:18:27+00:00Added an answer on June 10, 2026 at 7:18 pm

    So here is a simple test: http://jsbin.com/azaqog/1/ seems to be working fine. The issue you are facing is not evident in the provided data.

    The one thing I can now suspect is that the data you are parsing from the XML contains something that causing the final HTML to be invalid. I suggest that you parse the XML+XSLT into a raw text file, and look at the output. You should see something there that is breaking your html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Little trouble in using css, in the below code, i have used odd and
I'm a java novice and I've using the code below to display a list
I'm trying to slide background on hover. I used the code below in HTML
I've used the code below to display a map with multiple markers and infowindows.
I have created seven html pages and the code below is used to refersh
How can i display below toplinks in footer, i used below code in Footer.phtml
I have used below code to attach quckboook events // Subscribe to UI events...
I had used the below code to get the row index of the UIPickerView
I have some problem with my cfml website. I have used the below code
My below code works fine and is used to populate a <select> item with

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.