473,545 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'Replacement strings' in tagged data

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_descri ption>You caused problems with the
neighbours</section_descrip tion>

.... 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_descri ption> tag, OR.... is a way of having all the fields in the
file and this <section_descri ption> parsed with the variables at
Transformation time?

e.g. (making this up!)

<days>14</days>
<rent_paid_to>2 2 August 2004</rent_paid_to>
<amount_owed>45 6.50</amount_owed>

<section_descri ption>You owe at lease <some_sort_of_t ag value="days"> days
rent. Your rent is paid up to <xsl:value-of select="rent_pa id_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
Jul 20 '05 #1
1 1256
e.g. (making this up!)

<days>14</days>
<rent_paid_to>2 2 August 2004</rent_paid_to>
<amount_owed>45 6.50</amount_owed>

<section_descri ption>You owe at lease <some_sort_of_t ag value="days"> days
rent. Your rent is paid up to <xsl:value-of select="rent_pa id_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
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
23764
by: Steve S. | last post by:
I am looking for something in .NET that is functionally equivalent to the VB6 Mid() function, which allows me to replace a portion of a string at a specific position with another string. What I am trying to do is build a fixed length data record by starting with a string of blanks and then dropping in data at specific points within the...
2
1284
by: Art | last post by:
Hi & help, I'm trying to parse arithmetic expressions such as 4*(7-2.1). The first thing I'm trying is to add spaces to get: 4 * ( 7 - 2.1 ). I thought that Regular Expressions would be the way to go. I tried: regex.replace("\D", " \D ") which did not work. I don't know how to refer to the string that was matched in forming the...
4
2990
by: Sjaakie | last post by:
I need to replace parts of a string, in a collection deserialized from an XML file, with values from another collection. Is there another, more clever/faster/better, method than the loops below? TIA foreach (StringObject x in (StringObjectCollection)xc) { foreach (ReplacementStringObject r in
7
5078
by: Johan Tibell | last post by:
I use a tagged union to represent different expression types in one of my programs. struct exp { enum { LIT, VAR } type; union { int lit;
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.