Greetings
Am embarking on new project creating PDF using Apache FOP; XML + XSL:FO to PDF. Just looking at my data, designing XML layout, I have a string of text that currently (this is a rewrite PB into Java) has embedded tags within it, as stored on the database. This is a legal description of an Act/Section for example:
You owe at lease <X> days rent. Your rent is paid up to <Y> therefore your owe $<Z>.
I can obviously have X, Y & Z as normal separate tags within the XML file, its just that the description is on the database table and mostly this Act/Section description doesnt have embedded variables, e.g. "You caused problems with the neighbours". So I first thought...
<section_description>You caused problems with the
neighbours</section_description>
.... which is OK for the XSL/FO to place on the doc. But... there's the rare occurrence where this includes replacement variables within.
I can either easily parse this myself replacing any embedded variables when writing the XML file after reading text from the database <section_description> tag, OR.... is a way of having all the fields in the file and this <section_description> parsed with the variables at Transformation time?
e.g. (making this up!)
<days>14</days>
<rent_paid_to>22 August 2004</rent_paid_to>
<amount_owed>456.50</amount_owed>
<section_description>You owe at lease <some_sort_of_tag value="days"> days rent. Your rent is paid up to <xsl:value-of select="rent_paid_to"/> therefore your owe $<Z>.
I think the second tag above for rent_paid_to might be it - but this means I have to embed the XSL tags in the description in the database - no probs. Is this the way you'd go? Your thoughts appreciated.
Cheers
Rob
Am embarking on new project creating PDF using Apache FOP; XML + XSL:FO to PDF. Just looking at my data, designing XML layout, I have a string of text that currently (this is a rewrite PB into Java) has embedded tags within it, as stored on the database. This is a legal description of an Act/Section for example:
You owe at lease <X> days rent. Your rent is paid up to <Y> therefore your owe $<Z>.
I can obviously have X, Y & Z as normal separate tags within the XML file, its just that the description is on the database table and mostly this Act/Section description doesnt have embedded variables, e.g. "You caused problems with the neighbours". So I first thought...
<section_description>You caused problems with the
neighbours</section_description>
.... which is OK for the XSL/FO to place on the doc. But... there's the rare occurrence where this includes replacement variables within.
I can either easily parse this myself replacing any embedded variables when writing the XML file after reading text from the database <section_description> tag, OR.... is a way of having all the fields in the file and this <section_description> parsed with the variables at Transformation time?
e.g. (making this up!)
<days>14</days>
<rent_paid_to>22 August 2004</rent_paid_to>
<amount_owed>456.50</amount_owed>
<section_description>You owe at lease <some_sort_of_tag value="days"> days rent. Your rent is paid up to <xsl:value-of select="rent_paid_to"/> therefore your owe $<Z>.
I think the second tag above for rent_paid_to might be it - but this means I have to embed the XSL tags in the description in the database - no probs. Is this the way you'd go? Your thoughts appreciated.
Cheers
Rob