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 8841795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:48:31+00:00 2026-06-14T10:48:31+00:00

I am trying generate HTML code based of an xml file input shown below,expected

  • 0

I am trying generate HTML code based of an xml file input shown below,expected out is shown below,somewhere I am messing up the logic,I am getting a different output..can anyone point to what the issue is?

Input :-cr_fixes.xml file

<Fixes>
CR  FA  CL  Title
409452  WLAN    656885  Age out RSSI values from buffer 
409452,  12345          To Record HAL and SLM FW Event Logging
</Fixes>

EXPECTED OUTPUT:-

<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
 <td><a href="http://prism/CR/409452">409452</a></td>
<td>WLAN</td>
<td>656885</td>
<td>Age out RSSI values from buffer </td>
</tr>
<tr>
<td><a href=http://data/409452>409452</a>,<a href=http://data/12345>12345</a></td>
<td></td>
<td></td>
<td>To Record HAL and SLM FW Event Logging</td>
</tr>
</table>

ACTUAL OUTPUT:-

<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td>WLAN</td>
<td>656885</td>
<td>Age out RSSI values from buffer </td>
</tr>
<tr>
 <td><a href="http://prism/CR/409452,  12345">409452,  12345</a></td>
 <td><a href="http://prism/CR/409452,  12345">409452,  12345</a></td>
 <td><a href="http://prism/CR/409452,  12345">409452,  12345</a></td>
 <td><a href="http://prism/CR/409452,  12345">409452,  12345</a></td>
 <td></td>
 <td></td>
 <td>To Record HAL and SLM FW Event Logging</td>
 </tr>
</table>

PYTHON CODE:-

http://pastie.org/5390010

  • 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-14T10:48:33+00:00Added an answer on June 14, 2026 at 10:48 am
    TR_TEMPLATE.append('    <td>{}</td>'.format(cols[0]))
    TR_TEMPLATE = '\n'.join(TR_TEMPLATE)       #<--converts TR_TEMPLATE to a string
    

    In the second line, you convert TR_TEMPLATE from a list to a string. On susequent iterations through the loop, you’re trying to use .append on a string. you probably want to move the second line out of the loop and join at the end.

    Note that you have that same mistake at a few points in your code…

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

Sidebar

Related Questions

I'm trying to generate the following html code using cl-who: <html> <body> <div id=cnt_1></div>
I'm trying to generate some html programmatically in my code behind for a user
I am trying to generate a html code block when I click on a
I am trying to generate some HTML code from a VB.NET Web Method and
I am trying to generate some HTML code to list some images for a
I am trying to generate such HTML <form action=/some/process method=post> <input type=hidden name=foo.a value=aaa/>
I'm trying to generate html on the fly with javascript. I'm binding on the
As I mentioned here , I'm trying to generate HTML from an ASPX page
I am trying to generate an HTML page using data gathered in a form
I am trying to generate an html div in asp.net. Since a div is

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.