Re: How can I dynamically pass data to be formatted??

2002-01-29 Thread Thierry Gounelle



BRAHMA wrote:

 Hi All,

 Again a question...!!
  ---
?xml version=1.0?
root
money
net_amount5/net_amount
vatrate16%/vatrate
 vat8000/vat
total_amount58000/total_amount
currency_symbolDM/currency_symbol
ratio100/ratio
/money
/root
 --
 So I want to format the money value..I can use the format function

 But how can I dynamically select money value from xml file and pass to
 the format function of  xsl?
 
 xsl:decimal-format name=eurofrmt
 decimal-separator=, grouping-separator=./

 xsl:template match=/
 xsl:value-of
 select=format-number($net_amount, '#.###,00', 'eurofrmt')/
 /xsl:template


You should try

xsl:template match=/
xsl:value-of select=format-number(root/money/net_amount, '#.###,00',
'eurofrmt')/
/xsl:template

This is basic xsl/xpath stuff.

thierry


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Clueless Newbie is lost!

2002-01-29 Thread Thierry Gounelle

Hi tim,
I don't see any formating code in your post, just an xml source file.
Could you be more precise.

thierry

[EMAIL PROTECTED] wrote:

 Folks,
 I am writing a textbook on HTML, and want to
 include a chapter on XML.  I am trying to get the
 following code (DocBook) to generate a PDF file.
  After a LONG struggle I managed to
 xsltproc to use my XML and get the HTML to
 render...but the PDF eludes me.  Can y'all see
 anything wrong with the following code?

 When it is generated,
 by someone who knows what he is doing,
 the block quote stuff just
 disappears...the cite stuff renders
 just fine???

 What I am trying to do is simply show my
 student/readers how XML can be used.
 I have spent over 70 hours trying different
 software to no avail.  Ideas welcome!
 What I really need is a reliable tool-chain
 to take XML and generate HTML, PDF,
 and maybe one other format that I could
 capture and show the students.

 Can anyone help?

 Thanks in advance!

 tim

 ?xml version=1.0?
 !DOCTYPE article  SYSTEM ./docbookx.dtd
 article
 titleThere and Back Again/title
 artheader
 author
 firstnameBilbo/firstname
 surnameBaggins/surname
 /author
 pubdateLong Ago/pubdate
 /artheader
 para
 abbrevLOTR/abbrev stands for Lord of the Rings.
 In this paragaraph we could discuss
 the intricate details of the construction
 of a most proper hole in the ground.
 /para
 bridgeheadNow, a wonderful quote!/bridgehead
 para
 blockquote
 There were many paths that lead up into those
 mountains, and many passes over them.  But most
 of the paths were cheats and deceptions and
 lead nowhere or to bad ends; and most of the
 passes were infested by evil things and
 dreadful danger.
 citationPage 64 of
 citetitleThe Hobbit/citetitle
 by J. R. R. Tolkin/citation
 /blockquote
 /para
 /article

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: bugger fonts still won't work desperate...

2002-01-28 Thread Thierry Gounelle

Hi Jochen,
The metrics files are loaded using URI syntax, so either you specify a relative path 
like
font metrics-file=codegen/arial.xml ...
or a fully qualified path like
font metrics-file=file:///d:/fop/codegen/arial.xml ...

It's a bit confusing because you can specify d:/fop/codegen/Arial.ttf for the font 
but you are obliged to put the file:/// in front of the metrics file
path.

Hope it helps.
regards, thierry

[EMAIL PROTECTED] wrote:

 Ok here is the deal. I   adapted the userconfigfile like this:

 fonts
 font metrics-file=d:\fop\codegen\arial.xml kerning=yes embed-file
 =d:\fop\codegen\Arial.ttf
   font-triplet name=Arial style=normal weight=normal/
 /font
 font metrics-file=d:\fop\codegen\arialb.xml kerning=yes embed-file
 =d:\fop\codegen\Arialb.ttf
   font-triplet name=Arial style=normal weight=bold/
 /font
 font metrics-file=d:\fop\codegen\ariali.xml kerning=yes embed-file
 =d:\fop\codegen\Ariali.ttf
   font-triplet name=Arial style=italic weight=normal/
 /font
 font metrics-file=d:\fop\codegen\arialbi.xml kerning=yes
 embed-file=d:\fop\codegen\Arialbi.ttf
   font-triplet name=Arial style=italic weight=bold/
 /font
 font metrics-file=d:\fop\codegen\arialn.xml kerning=yes embed-file
 =d:\fop\codegen\Arianl.ttf
   font-triplet name=Arialn style=normal weight=normal/
 /font
   /fonts

 in the dir d:\fop\codegen i pasted the the generated xml-files and the
 ttf files

 but he still doesn't recognize the fonts when i render to pdf...

 what do i do wrong?

 how can i resolve it?

 Jochen Maes
 EDP departement
 Programmeur

 KBC-Securities
 Havenlaan 16
 1080 Brussel

 Tel : 02/429.96.81
 Fax : 02/429.17.48
 E-mail : [EMAIL PROTECTED]

 
**

 This message is for the named person's use only. It may contain
 confidential, proprietary or legally privileged information. You must not,
 directly or indirectly, use, disclose, distribute, print, or copy any part
 of this message if you are not the intended recipient. KBC Securities
 reserves the right to monitor all e-mail communications through its
 networks. Any views expressed in this message are those of the individual
 sender, except where the message states otherwise and the sender is
 authorised to state them to be the views of any such entity.
 
**

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: How can I dynamically pass data to be formatted??

2002-01-28 Thread Thierry Gounelle


Hi Brahma,
When you dynamicaly, do you mean that depending on an external parameter
you want, using the same xsl-fo file, write down either the total_amount
or the net_amount?
If so, you can for instance define a XML parameter file you read into
your xsl-fo file with the "document(...)" fonction, and test what you want
to print...
Or you can pass parameters to your xsl-fo template, but I am not sure
if it's possible to do it programatically to-day.
Thierry
BRAHMA wrote:
Hi All,
 Again a question...!!
---
 ?xml
version="1.0"?>
 root>
 money>
 net_amount>5/net_amount>
 vatrate>16%/vatrate>

vat>8000/vat>
 total_amount>58000/total_amount>
 currency_symbol>DM/currency_symbol>
 ratio>100/ratio>
 /money>
 /root>
--
So I want to format the money value..I can use the format function
But how can I dynamically select money value from xml file and pass
to the format function of xsl?

xsl:decimal-format name="eurofrmt"
decimal-separator="," grouping-separator="."/>
xsl:template match="/">
xsl:value-of
select="format-number($net_amount, '#.###,00', 'eurofrmt')"/>
/xsl:template>
or
xsl:template match="/">
xsl:value-of
select="format-number($total_amount, '#.###,00', 'eurofrmt')"/>
/xsl:template>

Any suggestion is a great help for me :).

best regards
brahma
-
Brahmaiah Kurabalakota
Software Developer
eMIS eMerging Information Systems GmbH
Am Friedrichsbrunnen
D-24782 Bdelsdorf
Tel.: +49 (4331) 447 1520
Mobile: +49 (172) 5372297
mailto: [EMAIL PROTECTED]
www.emis-intl.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Specific footer on the last page

2001-12-07 Thread Thierry Gounelle

Hi everybody,
Here is my problem:
I have a document that may have 1 to N pages. I would like to print
something on the footer of the last page (or at least on the bottom).
But, if there is only one page, the last page is also the first.
I tried something like:

fo:layout-master-set
 !-- layout for normal pages --
 fo:simple-page-master master-name=ordinary
   fo:region-body margin-top=.2cm/
   fo:region-after region-name=ordinary_footer extent=0cm/
 /fo:simple-page-master

 !-- layout information for the last page which contains a special
footer --
 fo:simple-page-master master-name=last_page
   fo:region-body margin-bottom=9.5cm/
   fo:region-after region-name=last_page_footer extent=9.5cm/
 /fo:simple-page-master

 fo:page-sequence-master master-name=contents
   fo:repeatable-page-master-alternatives
 fo:conditional-page-master-reference page-position=last
master-name=last_page/
 fo:conditional-page-master-reference page-position=first
master-name=ordinary/
 fo:conditional-page-master-reference page-position=rest
master-name=ordinary /
   /fo:repeatable-page-master-alternatives
 /fo:page-sequence-master 
/fo:layout-master-set


It doesnt work: I made several tests but it looks like I have the footer
on every page instead of the last one only.
For the last page footer, I'm using a static-content with the flow-name
set to the region-name defined in the layout.
Actually the footer is printed on every page, as if only
page-position=last is invoqued.
Do I miss something in the use of fo:conditional-page-master-reference?

Thanx a billion,
Thierry


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Specific footer on the last page

2001-12-07 Thread Thierry Gounelle

I tried the footnote trick but I have the following problem: if the
footnote doesnt fit in the first page, it has to go on the second with the
reference still on the first. I then have a nasty exception (it works fine
if everything is on the first page):

javax.xml.transform.TransformerException
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1212)

at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)

at java.lang.Thread.run(Unknown Source)
-
java.lang.NullPointerException
at org.apache.fop.fo.flow.TableBody.layout(TableBody.java:96)
at org.apache.fop.fo.flow.Table.layout(Table.java:226)
at org.apache.fop.fo.flow.FootnoteBody.layout(FootnoteBody.java:72)

at org.apache.fop.fo.flow.Footnote.layoutFootnote(Footnote.java:89)

at org.apache.fop.layout.Page.setPendingFootnotes(Page.java:201)
at
org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:344)
at
org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:266)
at
org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:191)
at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:178)
at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:284)

at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:749)

at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:495)

at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)

at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)

at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2097)

at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2029)

at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1189)

at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)

at java.lang.Thread.run(Unknown Source)
org.apache.fop.apps.FOPException
at org.apache.fop.apps.Driver.render(Driver.java:464)
at com.vth.lp.PrintInvoice.main(PrintInvoice.java:90)

Joerg Pietschmann wrote:

 Thierry Gounelle [EMAIL PROTECTED] wrote:
  Here is my problem:
  I have a document that may have 1 to N pages. I would like to print
  something on the footer of the last page (or at least on the bottom).

 This may be more tricky than it seems at a first glance.
 One possibility is to put the text into a footnote and refer to it from
 an otherwise empty block at the end of the text. Specify a character
 which does not render a visibly glyph as the footnote character, like
 a zero width space. You might have to customize the footnote separator
 as well.

 HTH
 J.Pietschmann

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Footer on the last page

2001-12-06 Thread Thierry Gounelle



Hi everybody,
Here is my problem:
I have a document that may have 1 to N pages. I would like to print
something on the of the last page. If there is only on page, the last page
is also the first.
I tried something like:
fo:layout-master-set>
!-- layout for "normal" pages -->
fo:simple-page-master master-name="ordinary"
 fo:region-body margin-top=".2cm"/>
 fo:region-after region-name="ordinary_footer" extent="0cm"/>
/fo:simple-page-master>
!-- layout information for the last page which contains a
special footer -->
fo:simple-page-master master-name="last_page"
 fo:region-body margin-bottom="9.5cm"/>
 fo:region-after region-name="last_page_footer" extent="9.5cm"/>
/fo:simple-page-master>

fo:page-sequence-master master-name="contents">
 fo:repeatable-page-master-alternatives>
 fo:conditional-page-master-reference page-position="last"
master-name="last_page"/>
 fo:conditional-page-master-reference page-position="first"
master-name="ordinary"/>
 fo:conditional-page-master-reference page-position="rest"
master-name="ordinary" />
 /fo:repeatable-page-master-alternatives>
/fo:page-sequence-master >
/fo:layout-master-set>
If the footer doesn't fit on a page according to the body dimension,
then I want it on an additional page that will be the last, but then, I
want a different layout for the (N-1) previous pages: without any footer.
It doesnt work: I made several tests but it looks like I have the footer
on every page instead of the last one only.
Thanx a billion,
Thierry

Arved Sandstrom wrote:

Hi,
JensIn the page masters
you can explicitly specify the region-master names also, using the 'region-name'
property. It so happens that many people leave these off in examples, and
the default values (such as 'xsl-region-start') get assigned. So don't
trust examples all the time. :-)Let's
say you have one page-master for the first page, and another page-master
for the rest of the pages. Give the region-before's different region-names.
Then, in your page-sequence, define 2 static-contents for the headers,
one of which references one region-name, and the other references the other
region-name. They will get appropriately mapped.Hope
this helps.Arved Sandstrom

- Original Message -

From:
Jens
Eckert

To: [EMAIL PROTECTED]

Sent: Monday, December 03, 2001 11:21
AM

Subject: Re: a custom header according
to page number
I do have a similar (or the same?) problem. I have a flow that
runs through all the pages. On the first page, though, I'd like to have
a different header (static content). So far I defined two simple-page masters
and a page-sequence-master that uses a simple-page master for the first
page and the other one for the rest.
But where do I specify where which (static content) header to use? In
the page-masters I can only set margins etc.(?) I tried to use two
page-sequences, one for each page master, but then I get the XML-content
twice: once for the first page sequence once for the second. Can I specify
static content in the page-master?
Thanks
Jens

Cyril Rognon schrieb:
If you only need to ditinguish the first
page from the other ones, simply use a different page-master (reference
or name ;-) according to the spec conformance) and use this page master
for your cover page only. This will do the trick easily.
one page-master for the cover (one page-sequence using this page-master-reference)
, and different page-master for the rest of the page sequences.
I strongly recomend you to read some FO tutorial, this will spare you
a lot of research work (you'll find some ref on http://www.w3.org/Style/XSL/)
At 14:18 03/12/2001 +, you wrote:
Thanks
Cyril,
please see answers
below


Your question is a little underspecified ...


...


[Ismaeil, Sameh]
no, I don't want to distinguish odd and even pages, specifically, I need
to distinguish the frist page from the rest of the pages, any clue?


Don't think about using some predicate considering the page number, xsl
fo and fop are loosely coupled, it is meant to be that way. So it forbids
the user to use the internal page number programaticaly (some FO processor
provide extension to do this, fop does not).


[Ismaeil, Sameh]
yes, I kind of noticed that , it is usually one way: FOP code -> fo XSL
->pdf document


if your need is more complex and you have some magic formula to guess wich
page is affected, conditionnal master-page may be to low level ...


[Ismaeil, Sameh]
I'll give conditional-master-page some insight and hope it will work, thanks
a lot


Good luck.


...



Cyril Rognon
http://www.objectiva.fr