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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:57:54+00:00 2026-05-26T21:57:54+00:00

I have report that I must convert to PDF using xsl-fo from xml data

  • 0

I have report that I must convert to PDF using xsl-fo from xml data coming from a MySQL database.

The xml structure that I am working on has already been used to create a HTML report.

There are certain fields that already have html tags inside that I was able to use in the HTML report by adding disable-output-escaping=”yes” to my xsl:value-of’s statement.

How do I do the similar operation in xsl-fo? Is there a way I can change the tags to be fo:inline? Or perhaps something I can change in the database output that will be the equivalent PDF version of bolding?

Here is a xml snippet:

<foal_line>
  <yob>0</yob> 
  <description>Tis The Alarm. Unplaced at 3 in NA. Dam of <B>SA MOKEN</B> (f, by Smoke Glacken. 2 wins at 2, $60,382 in NA. Won Ken Kendrick Memorial Futurity (SRP, $25,043). 2nd Kachina S. (RUI, $10,982). 3rd Ruidoso Thoroughbred Futurity (RUI, $7,787), etc.) Granddam of <B>Dream Kin</B> (f, by Desert God. 4 wins, 2 to 4, $127,880 in US. 2nd New Mexico Cup Juv. Fillies S.-R (ZIA, $33,440). 3rd C. O. "Ken" Kendrick Memorial S-R (SRP, $7,500), Lincoln H. [R] (RUI, $5,000), Carlos Salazar S. [N] (ALB, $4,000), etc.)</description> 
</foal_line>

My previous xslt snippet to create xhtml:

<tr>
   <td width="30px" style="vertical-align:text-top;">
  <xsl:value-of select="yob"/>
   </td>
   <td style="vertical-align:text-top;text-align:left;padding-left:2px">
  <xsl:value-of select="description" disable-output-escaping="yes" />
   </td>
</tr>

My current xsl-fo snippet:

<fo:table-row>
    <fo:table-cell>
       <fo:block><xsl:value-of select="yob"/></fo:block>
    </fo:table-cell>
    <fo:table-cell>
       <fo:block><xsl:value-of select="description"/></fo:block>
    </fo:table-cell>
</fo:table-row>

Edit:
Here is what I’m really getting from the server. That’s what I get for using IE to view my xml.

<foal_line>
  <yob>0</yob> 
  <description>Tis The Alarm. Unplaced at 3 in NA. Dam of &lt;B&gt;SA MOKEN&lt;/B&gt; (f, by Smoke Glacken. 2 wins at 2, $60,382 in NA. Won Ken Kendrick Memorial Futurity (SRP, $25,043). 2nd Kachina S. (RUI, $10,982). 3rd Ruidoso Thoroughbred Futurity (RUI, $7,787), etc.) Granddam of &lt;B&gt;Dream Kin&lt;/B&gt; (f, by Desert God. 4 wins, 2 to 4, $127,880 in US. 2nd New Mexico Cup Juv. Fillies S.-R (ZIA, $33,440). 3rd C. O. "Ken" Kendrick Memorial S-R (SRP, $7,500), Lincoln H. [R] (RUI, $5,000), Carlos Salazar S. [N] (ALB, $4,000), etc.)</description> 
</foal_line>

This is why suggested answer is not working.

  • 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-05-26T21:57:55+00:00Added an answer on May 26, 2026 at 9:57 pm

    Instead of doing xsl:value-of for <description>, do xsl:apply-templates. You can then create a template to match <B>. In the B template you can use fo:inline to make the text bold.

    Here’s an example:

      <xsl:template match="foal_line">
        <fo:table-row>
          <fo:table-cell>
            <fo:block><xsl:value-of select="yob"/></fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block><xsl:apply-templates select="description"/></fo:block>
          </fo:table-cell>
        </fo:table-row>
      </xsl:template>
    
      <xsl:template match="description">
        <xsl:apply-templates/>
      </xsl:template>
    
      <xsl:template match="B">
        <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
      </xsl:template>
    

    Using your XML input and the above templates, the following output is generated:

    <fo:table-row xmlns:fo="http://www.w3.org/1999/XSL/Format">
       <fo:table-cell>
          <fo:block>0</fo:block>
       </fo:table-cell>
       <fo:table-cell>
          <fo:block>Tis The Alarm. Unplaced at 3 in NA. Dam of <fo:inline font-weight="bold">SA MOKEN</fo:inline> (f, by Smoke Glacken. 2 wins at 2, $60,382 in NA. Won Ken Kendrick Memorial Futurity (SRP, $25,043). 2nd Kachina S. (RUI, $10,982). 3rd Ruidoso Thoroughbred Futurity (RUI, $7,787), etc.) Granddam of <fo:inline font-weight="bold">Dream Kin</fo:inline> (f, by Desert God. 4 wins, 2 to 4, $127,880 in US. 2nd New Mexico Cup Juv. Fillies S.-R (ZIA, $33,440). 3rd C. O. "Ken" Kendrick Memorial S-R (SRP, $7,500), Lincoln H. [R] (RUI, $5,000), Carlos Salazar S. [N] (ALB, $4,000), etc.)</fo:block>
       </fo:table-cell>
    </fo:table-row>
    

    Also, you should do the same for <yob> if it is also mixed content (text and other elements such as <B>).

    You can also do this for your XHTML XSLT so you don’t have to use disable-output-escaping (which I try to avoid at all costs).

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

Sidebar

Related Questions

I have a report that renders data returned from a stored procedure. Using profiler
I have a report that I'm exporting to PDF using the VS2008 version of
I have a report that needs to get data from two logical areas of
I have a report that takes two parameters from a couple of text boxes
I have a program that outputs a report into plain text. The report must
I have an Oracle Report that must be in pure Black and White. It
I have a report that uses a TChart that I am maintaining. One of
I have a report that is used by a windows service and a form
I have a report that I created with Crystal Reports 2008. This report uses
I have a report that calculates multiple date differences (in business days, not DATEDIFF)

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.