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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:48:38+00:00 2026-06-11T23:48:38+00:00

I have some data in a database which i need to use to generate

  • 0

I have some data in a database which i need to use to generate an HTML file.
The format of the HTML file will always be the same, i.e. it will always look something like this

 -----------------------------------------
                                        |
[Header]                                |
- Advertising banner                    |
                                        |
[Body]                                  |
                                        |
----------------------------------      |
Content column  | content column |      |
Content column  | content column |      |
Content column  | content column |      |
----------------------------------      |
Content column  | content column |      |   
Content column  | content column |      |
----------------------------------      |
                                        |
[Footer]                                |   
                                        |
- Copyright information etc             |
                                        |
-----------------------------------------

The data i will be reading from the database table will be read using JDBC. I know i can generate the HTML file by manually coding the HTML source with the tags but im sure this is not the correct way of doing it.

Is there some sort of templating mechanism where i have a template for the HTML file which could probably have placeholders for the content sections which i can then update at run time after i have read the content from the database.

I thought that XSLT was specifically created for this purpose but looking at Google it looks like XSLT is for transorming XML to other formats which is not what i want. I could probably convert the data i read from the database into XML and use XSLT but this seems like an additional unessary layer of processing.

What is the usual/common way of approaching this kind of problem?

I would prefer to use Spring/Maven but open to other suggestions.

Thanks

Edit

Also, please note that the HTML file that is generated is not for displaying on the browser/web. It is displayed in an Email. A new HTML file will be generated everyday.

  • 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-11T23:48:40+00:00Added an answer on June 11, 2026 at 11:48 pm

    My suggestion would be to use XSLT – many DB can already produce results as XML, or you can write easily code to convert your SQL query results in simple XML:

    <table>
      <row>
         <firstColumn>...</firstColumn>
         <secondColumn>...</secondColumn>
         . . . 
      <row>
      . .  .
    </table>
    

    Once you have this XML using XSLT you can generate any HTML – or many other formats – in a way that is standard, well-supported and very very flexible.

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

Sidebar

Related Questions

I have a simple jasper report which shows some data from database. The jasper
I have an App which receives a SQLite database to read some data and
I have some data in a database that I need represented in an XML
I have some data in the database, in this format: Description~Level||Description~Level|| I want to
i am getting problem as i have some data in a database tabel file
I have a form and I need to add some data from database before
I have some EJBs that use Hibernate to persist data to the database. I
I have some xml data contained in three files (Database.xml, Participants.xml, and ConditionTokens.xml). I
I have fetched some data from a SQL database into a datagridview, but after
We have recently moved some data from an SQL Database instance to another one

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.