473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Finding the value of "TOP" from prior block-containers used

Hi all,

My main problems are:::::::::

1. Set a value within a block container that can be used and changed by
subsequent templates/block-containers/tables etc..
2. get/determine/find the setting that tell the process that the new
top of the document region is now at the end of the last
block-container used, this must be set in that last block container.
3. find the value used in the 'top" setting on the prior
position="absolute" in the block container.

What I am trying to do is::::::

We have an existing system that has some reports; these reports need to
be reproduced verbatim in a PDF format using XML&XSL --> FOP --> PDF.

The reports aren't to complex and we have devised a way in which the
existing programs can write out a useful XML file that has the
structure as per the previous report, see XML further down.

The text and structure of the report will be kept using an XSL style
sheet.

I have automated the XSL creation as there a many reports that are
required so it doesn't make sense to sit down and manually code these
to style sheets, I wrote a program that looked at the structure of
existing reports and wrote the appropriate XSL syntax for it (but I
need a workable template!!, so this is what is sending me a bit,loopy)
I have been able to get the XML elements to line up correctly, but the
main problem is that some of the elements need to be placed in an exact
position (lines down) on the page, and then the rest of the elements
need to be placed after that absolute positioned block. This means I
don't care about the positioning of any XML tags that follow the TAG
that was absolutely positioned via the block-container, but, the
following XML tags (and content etc.) should start after the block
container that was absolutely positioned (confused, well, whose on
first).

What I have done so far:::::::CPI & LPI conversion

Match the report LPI and CPI --> easy enough done by using courier new
and setting line-height and height as an attribute of the
block-container or the table that is being used. Some report lines need
to absolutely positioned --> Can be done via the shorthand
block-container position="absolute", in fact works greater. Please see
following:

<fo:block-container xsl:use-attribute-sets="block-container"
top="1*{$doc-line}in">

<xsl:attribute-set name="block-container">
<xsl:attribute name="position">absolute</xsl:attribute>
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="height">0.1in</xsl:attribute>
<xsl:attribute name="line-height">0.1in</xsl:attribute>
</xsl:attribute-set>

<fo:table xsl:use-attribute-sets="table">

<xsl:attribute-set name="table">
<xsl:attribute name="table-layout">fixed</xsl:attribute>
<xsl:attribute
name="inline-progression-dimension.maximum">100%</xsl:attribute>
<xsl:attribute name="height">0.1in</xsl:attribute>
<xsl:attribute name="line-height">0.1in</xsl:attribute>
</xsl:attribute-set>

I am using the xsl:use-attribute-sets as the attribute set resides in
another XSL, it made sense to me that. If I wish to change this for any
reason I could change it one place, and it would update all the style
sheets that use it.

Please also note that in the block-container I have used the
top="1*{$doc-line}in". The 1 is a static value for each
block-container, the program I have written to create the XSL places it
there and, the $doc-line is a global variable that has been set to 0.1,
so the calculation top=1*0.1 in or top = 0.1in, this means that the
absolute positioning of this 0.1in from the top, as the lines on the
previous reports were 10 lines per inch it matches perfectly.

What I have done so far::::::: detail line conversion.

The detail line is broken up into table-columns, each detail line can
be different to the last, but I need to keep the details of the lineup
of the line to be the same so it will match the previous report, the
way I did this was to use the following, please note the prior report
was 132 chars across, so this report should be the same, also that the
proportional-column-width() will add up to 100% even though the total
is 132, that is that it will add up all then proportion them to the
100% used.

<xsl:template match="DTL01">
<fo:table xsl:use-attribute-sets="table">
<fo:table-column column-width="proportional-column-width(7)"/>
<fo:table-column column-width="proportional-column-width(3)"/>
<fo:table-column column-width="proportional-column-width(40)"/>
<fo:table-column column-width="proportional-column-width(3)"/>
<fo:table-column column-width="proportional-column-width(30)"/>
<fo:table-column column-width="proportional-column-width(49)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell text-align="right">
<fo:block>
<xsl:call-template name="formatZeroDecimals">
<xsl:with-param name="number" select="CLTKYC"/>
</xsl:call-template>
</fo:block>
</fo:table-cell>
<fo:table-cell/>
<fo:table-cell>
<fo:block>
<xsl:value-of select="CLNAMC"/>
</fo:block>
</fo:table-cell>
<fo:table-cell/>
<fo:table-cell>
<fo:block>
<xsl:value-of select="ADDR1C"/>
</fo:block>
</fo:table-cell>
<fo:table-cell/>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>

This is the second main detail line:::::: (again 132)

<xsl:template match="DTL02">
<fo:table xsl:use-attribute-sets="table"/> <!-- space line -->
<fo:table xsl:use-attribute-sets="table">
<fo:table-column column-width="proportional-column-width(53)"/>
<!-- spaces -->
<fo:table-column column-width="proportional-column-width(2)"/>
<!-- text -->
<fo:table-column column-width="proportional-column-width(2)"/>
<!-- spaces -->
<fo:table-column column-width="proportional-column-width(16)"/>
<!-- phone -->
<fo:table-column column-width="proportional-column-width(59)"/>
<!-- spaces -->
<fo:table-body>
<fo:table-row>
<fo:table-cell/>
<fo:table-cell>
<fo:block>P:</fo:block>
</fo:table-cell>
<fo:table-cell/>
<fo:table-cell>
<fo:block>
<xsl:value-of select="PHONEC"/>
</fo:block>
</fo:table-cell>
<fo:table-cell/>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>

What I cannot yet do:::::::::::::::::::::::::::::::::::!!!???##@@!!

The detail lines i.e. DTL01 & DTL02 must follow an absolutely position
line that is set in about the middle of the page, in some case 3/3 or
1/4 down the page, it varies in some reports.

I have tried creating a variable that is set within the block
container, but it cannot be passed to subsequent templates and the
value is only set within the template that is being processed. In some
cases the absolute positioned tag may not be placed on the report.

There is no counter I can increment for line number or any other number
number I wish to make up. Some things can be counted, like node()
position(), but these are no good to me as I wish to count lines, in
some cases I wish to write a space between the lines (see DTL02).

Variable are static in XSL, and cannot be incremented, that suck, I
mean that really suck, it is like meatloaf through a straw it sucks and
it sucks hard.

What I would like to do is one of the following:::::::::

1. Set a value within a block container that can be used and changed by
subsequent templates.
2. get the setting that tell the process that the new top of the
document region is now at the end of the last block-container used,
this must be set in that last block container.
Please see full XML:::::::::::::::::::::::::::

Please note in this case it is the HEADER and the CHEQUE_AMOUNT are the
ones that need to be absolutely positioned, and the DTL01 and DTL02
need to come after the CHEQUE_AMOUNT

<?xml version="1.0" encoding="UTF-8"?>
<REPORT>
<DATE>23092005</DATE>
<TIME>10403700</TIME>
<LAYOUT></LAYOUT>
<DESIGN></DESIGN>
<CL999>
<HEADER>
<CMPNY_>Company NameXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CMPNY_>
</HEADER>
<TOT01>
<CHEQUE_AMOUNT>123456</CHEQUE_AMOUNT>
</TOT01>
<DTL01>
<CLTKYC>0000001</CLTKYC>
<CLNAMC>Client NameXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CLNAMC>
<ADDR1C>Address line 1XXXXXXXXXXXXXXXX</ADDR1C>
<UNDCDC>UCD</UNDCDC>
<_UNDCD>Underwriter codeXXXXXXXXXXXXXX</_UNDCD>
</DTL01>
<DTL02>
<PHONEC>+03 9576 4533XXX</PHONEC>
</DTL02>
<DTL01>
<CLTKYC>0000002</CLTKYC>
<CLNAMC>Client NameXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CLNAMC>
<ADDR1C>Address line 1XXXXXXXXXXXXXXXX</ADDR1C>
<UNDCDC>UCD</UNDCDC>
<_UNDCD>Underwriter codeXXXXXXXXXXXXXX</_UNDCD>
</DTL01>
<DTL02>
<PHONEC>+03 9576 4533XXX</PHONEC>
</DTL02>
<DTL01>
<CLTKYC>0000003</CLTKYC>
<CLNAMC>Client NameXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CLNAMC>
<ADDR1C>Address line 1XXXXXXXXXXXXXXXX</ADDR1C>
<UNDCDC>UCD</UNDCDC>
<_UNDCD>Underwriter codeXXXXXXXXXXXXXX</_UNDCD>
</DTL01>
<DTL02>
<INDEXC>IndexXXXXXXXXXXX</INDEXC>
<ADDR2C>Address line 2XXXXXXXXXXXXXXXX</ADDR2C>
<SERCLC>X</SERCLC>
<_SERCL>Service classXXXXXXXXXXXXXXXXX</_SERCL>
</DTL02>
</CL999>
</REPORT>

Nov 11 '05 #1
2 2191
TadPole wrote:
Hi all,

My main problems are:::::::::


I think this is best posted to the XSL List rather than c.t.x
(see www.mulberrytech.com for joining)

///Peter

Nov 23 '05 #2
Thaks for the re-direction.

The people at mulberry have re-directed me to ww********@w3.org

so the quest begins....

Nov 23 '05 #3

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

Similar topics

4
by: Flapper | last post by:
Help please, Have a situation when converting from Oracle SP's to SQL SP's. The old oracle cursor was roughly as follows CURSOR cur_rsStock IS select * from (select StockRowId, CategoryId
1
by: boonkit | last post by:
Hi all, I cannot find MySQl performance info at linux "top" command. I already tested on slow MySQL query that took more than 5 minutes (create fulltext index), but during the 5 minutes, i...
6
by: Matt | last post by:
When I do the following, the mycode will still execute. The reason I put window.opener=top; is to disable the close confirmation dialog box. window.opener = top; window.close(); //mycode... ...
19
by: Mason A. Clark | last post by:
How was I to know that "top" means "top" in MSIE6 ?? I was testing <a name="top"></a> at the top of the page with <a href="#top>go to top</a> at the bottom of the page. It always worked in...
6
by: Mason A. Clark | last post by:
LAST WORD(s): 1. MSIE6 and Firefox will go to the top of the page on command <a href="#top">go upsy</a> even if there is NO name="top" or id="top" They know what a "top" is :-) Opera...
16
by: Gufus | last post by:
Hi Group... <a name="#top"></a> ----del---- ----del---- <img SRC="images/top.gif" USEMAP="#top" BORDER=0> <map NAME="top">
16
by: J. C. Denton | last post by:
I just manually validated alexa's global top 100 sites and find only 2 sites that pass validation. They are http://www.microsoft.com/ http://www.wikipedia.org/ All others should go w3c...
3
by: Brett Romero | last post by:
I have an MDI Parent form with a toolstrip and menustrip. The menustrip is always the top most. Both are Docked to Top. I contemplated using a toolstripcontainer but then removed it. I had to...
3
by: snoonan | last post by:
The company in quesiton does construction work. Tables look like this: ***Job Table*** JobNumberID* JobName ***JobNote Table*** JobNoteID* JobNumberID* JobNoteCreateDate
1
by: sheldonlg | last post by:
I define a div, excItem, with absolute positioning and with a top of 400px. I then call a javascript function which does toggling of visibility and should do positioning as well. I loop though...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.