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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:30:00+00:00 2026-06-08T03:30:00+00:00

I have a plain ole’ HTML document. It gets read into some Java code

  • 0

I have a plain ole’ HTML document. It gets read into some Java code I wrote and translated into a PDF via some XSL-T and Apache FOP.

My issue is, this HTML document is a legal form that should be pre-populated with values contained in a Java object before being sent off to various computers/users. How can I read in dynamic (run-time) data and then continue to transform it as usual?

I would like to know of a strategy/technology to do this that can be completed server-side. Any ideas would be appreciated!

(I could take a very ugly solution where I piece together Strings in my Java code and insert in the data one piece at a time in the middle, but I have many pieces and that code would be difficult for my company to maintain.)

EDIT: To clarify — I found this answer already on SO that addresses something similar. In that question, it addresses reading data in from a user’s browser via text entry into a form, I believe. That is a client-side issue. I need to read data from Java code, which is on the server side.

  • 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-08T03:30:02+00:00Added an answer on June 8, 2026 at 3:30 am

    My question was not worded very well, allow me to clarify what I was trying to accomplish and how I accomplished it (for Google-viewers.)

    I had a document encoded in XHTML (well formed HTML). I needed an end result of a PDF version of this document with some data gathered at run-time. I do not think my solution is novel or even close to the best way someone might do it, but for the sake of closure, I am going to list it:

    1. Insert tags into HTML/XML document that indicate a value needs to be filled in later. For example <day/> for the day from a timestamp.

    2. Retain my existing XSL-T document to convert the text from XML to a PDF format. It ignores all tags like <day/> which is nice because I didn’t immediately have all of the fields ready to be replaced.

    3. Create code using simple regular expressions to replaceFirst("<day/>", getTimestamp()) the tags with the appropriate content at runtime. This method needed to be called via a “struts” event that was triggered when the user entered in the data.

    4. When run, the program accepts user data, calls a method to read in the XHTML file, replace the fields with the data gathered, pass on the modified file to my XSLT transformation using Apache FOP.

    This isn’t elegant, but it does the trick.

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

Sidebar

Related Questions

I have an XSLT file generating plain HTML. I need to wrap some elements
I have some plain text and html. I need to create a PHP method
I have some Plain Text/HTML Content like so: Title: Lorem ipsum dolor sit amet,
I have plain text with some custom tags. For example: I like C#. <code
I have plain HTML file and I want to include some JSTL tags in
I have a plain html web page with an embedded flash object. Based on
In an iPhone application, I have some plain C functions. Is it possible to
I have a plain text document, which I want to compile inside LaTeX. However,
I have some plain text file (.xls extension) with next markup (attached below). It's
I have a plain vanilla layout: <ScrollView> <TableLayout> <TableRow> ... but the content gets

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.