'Replacement strings' in tagged data

R

RobM

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
 
R

RobM

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

....which means embedded <xsl...> tag in the XML file - whereas I have to
XSL/XSL:FO tags in an associated XSL file. Is this correct?

Cheers
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top