Can I get current date and time XSL-FO??How???

View: New views
8 Messages — Rating Filter:   Alert me  

Can I get current date and time XSL-FO??How???

by manl799 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi dear Nabble staff,
...... i have a problem very difficult to solve for me....
....I have Oracle APEX Web developer to make a report in XSL-FO and to translate it into PDF and i want to customize reports made by APEX.

I tried to get current date and/or time in XSL-FO file but I can't to find a solution for this....

I tried to create customized functions made with Javascript, msxsl code and with XSQL but nothing....

this is my XSL-FO code......tell me what i should write and where!!!...thanks

<?xml version = '1.0' encoding = 'utf-8'?>
<xsl:stylesheet version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"                
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="html" />

.....
   <xsl:attribute-set name="page-number">
      <xsl:attribute name="height">13.872pt</xsl:attribute>
   </xsl:attribute-set>
   <xsl:attribute-set name="header-font">

     .....

   <xsl:template match="/">
      <fo:root>
         <fo:layout-master-set>
            <fo:simple-page-master master-name="master0" margin-left="66.6pt" margin-right="66.6pt" page-height="#PAGE_HEIGHT#pt" page-width="#PAGE_WIDTH#pt" margin-top="36.0pt" margin-bottom="36.0pt">
                 ........
</fo:block>                  
<fo:block>
   Page  <fo:page-number/>
</fo:block>
<fo:block text-align="right">
<fo:external-graphic
src="http://www.fiddlersgreen.net/AC/aircraft/Caproni-Stipa/IMAGES/Stipa-Caproni-cartoon.jpg" />
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
             ....

   </xsl:template>
</xsl:stylesheet>

Parent Message unknown AW: Can I get current date and time XSL-FO??How???

by Huditsch, Roman (LNG-VIE) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

According to your stylesheet snippet you are fortunately using XSLT 2.0, so you can have a look at the function current-date() and current-dateTime ().
Putting an <xsl:value-of select="current-dat()"/> where you want to output the date should get you a step further.
If you need to change the date's format, have a look at format-date().
Hope this helps!

Best regards,
Roman

--------------------------
Sent from my BlackBerry Wireless Device

----- Originalnachricht -----
Von: www-xsl-fo-request@... <www-xsl-fo-request@...>
An: www-xsl-fo@... <www-xsl-fo@...>
Gesendet: Thu Apr 03 16:38:01 2008
Betreff: Can I get current date and time XSL-FO??How???


Hi dear Nabble staff,
....... i have a problem very difficult to solve for me....
.....I have Oracle APEX Web developer to make a report in XSL-FO and to
translate it into PDF and i want to customize reports made by APEX.

I tried to get current date and/or time in XSL-FO file but I can't to find a
solution for this....

I tried to create customized functions made with Javascript, msxsl code and
with XSQL but nothing....

this is my XSL-FO code......tell me what i should write and
where!!!...thanks

<?xml version = '1.0' encoding = 'utf-8'?>
<xsl:stylesheet version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"                
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="html" />

......
   <xsl:attribute-set name="page-number">
      <xsl:attribute name="height">13.872pt</xsl:attribute>
   </xsl:attribute-set>
   <xsl:attribute-set name="header-font">

     .....

   <xsl:template match="/">
      <fo:root>
         <fo:layout-master-set>
            <fo:simple-page-master master-name="master0"
margin-left="66.6pt" margin-right="66.6pt" page-height="#PAGE_HEIGHT#pt"
page-width="#PAGE_WIDTH#pt" margin-top="36.0pt" margin-bottom="36.0pt">
                 ........
</fo:block>                  
<fo:block>
   Page  <fo:page-number/>
</fo:block>
<fo:block text-align="right">
<fo:external-graphic
src="http://www.fiddlersgreen.net/AC/aircraft/Caproni-Stipa/IMAGES/Stipa-Caproni-cartoon.jpg"
/>
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
             ....

   </xsl:template>
</xsl:stylesheet>
--
View this message in context: http://www.nabble.com/Can-I-get-current-date-and-time-XSL-FO--How----tp16467521p16467521.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.




Re: AW: Can I get current date and time XSL-FO??How???

by manl799 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Thanks for your sentence......I tried this but i can't display PDF output file(i tried to display it also with WORD and HTML)......

i add this part of code
.....
<fo:block>
<xsl:value-of select="current-date()" />  (i used also current-dateTime())
</fo:block>

......but
......with WORD and HTML  i have a blank page while with PDF I have an error message that says:
"the file cannot be opened because it's a file not supported or it may be damaged!"


it seems that don't know this function!!!!
What can i do???
May be a problem of XSLT engine???....How can i change it???

Best regards,
Emanuele



Huditsch, Roman (LNG-VIE) wrote:
Hi,

According to your stylesheet snippet you are fortunately using XSLT 2.0, so you can have a look at the function current-date() and current-dateTime ().
Putting an <xsl:value-of select="current-dat()"/> where you want to output the date should get you a step further.
If you need to change the date's format, have a look at format-date().
Hope this helps!

Best regards,
Roman

--------------------------
Sent from my BlackBerry Wireless Device

----- Originalnachricht -----
Von: www-xsl-fo-request@w3.org <www-xsl-fo-request@w3.org>
An: www-xsl-fo@w3.org <www-xsl-fo@w3.org>
Gesendet: Thu Apr 03 16:38:01 2008
Betreff: Can I get current date and time XSL-FO??How???


Hi dear Nabble staff,
....... i have a problem very difficult to solve for me....
.....I have Oracle APEX Web developer to make a report in XSL-FO and to
translate it into PDF and i want to customize reports made by APEX.

I tried to get current date and/or time in XSL-FO file but I can't to find a
solution for this....

I tried to create customized functions made with Javascript, msxsl code and
with XSQL but nothing....

this is my XSL-FO code......tell me what i should write and
where!!!...thanks

<?xml version = '1.0' encoding = 'utf-8'?>
<xsl:stylesheet version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"                
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="html" />

......
   <xsl:attribute-set name="page-number">
      <xsl:attribute name="height">13.872pt</xsl:attribute>
   </xsl:attribute-set>
   <xsl:attribute-set name="header-font">

     .....

   <xsl:template match="/">
      <fo:root>
         <fo:layout-master-set>
            <fo:simple-page-master master-name="master0"
margin-left="66.6pt" margin-right="66.6pt" page-height="#PAGE_HEIGHT#pt"
page-width="#PAGE_WIDTH#pt" margin-top="36.0pt" margin-bottom="36.0pt">
                 ........
</fo:block>                  
<fo:block>
   Page  <fo:page-number/>
</fo:block>
<fo:block text-align="right">
<fo:external-graphic
src="http://www.fiddlersgreen.net/AC/aircraft/Caproni-Stipa/IMAGES/Stipa-Caproni-cartoon.jpg"
/>
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
<fo:block text-align="center">
STIPA bla bla bla bla bla bla
</fo:block>
             ....

   </xsl:template>
</xsl:stylesheet>
--
View this message in context: http://www.nabble.com/Can-I-get-current-date-and-time-XSL-FO--How----tp16467521p16467521.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.



AW: AW: Can I get current date and time XSL-FO??How???

by Huditsch, Roman (LNG-VIE) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Unfortunately, I don't know which XSLT processor the Oracle APEX Web developer uses.
For using these functions an XSLT 2.0 compatible processor like Saxon or Gestalt is needed.

Cheers,
Roman


-----Ursprüngliche Nachricht-----
Von: www-xsl-fo-request@... [mailto:www-xsl-fo-request@...] Im Auftrag von manl799
Gesendet: Freitag, 4. April 2008 11:51
An: www-xsl-fo@...
Betreff: Re: AW: Can I get current date and time XSL-FO??How???




Thanks for your sentence......I tried this but i can't display PDF output
file(i tried to display it also with WORD and HTML)......

i add this part of code
......
<fo:block>
<xsl:value-of select="current-date()" />  (i used also current-dateTime())
</fo:block>

.......but
.......with WORD and HTML  i have a blank page while with PDF I have an error
message that says:
"the file cannot be opened because it's a file not supported or it may be
damaged!"


it seems that don't know this function!!!!
What can i do???
May be a problem of XSLT engine???....How can i change it???

Best regards,
Emanuele




Huditsch, Roman (LNG-VIE) wrote:

>
> Hi,
>
> According to your stylesheet snippet you are fortunately using XSLT 2.0,
> so you can have a look at the function current-date() and current-dateTime
> ().
> Putting an <xsl:value-of select="current-dat()"/> where you want to output
> the date should get you a step further.
> If you need to change the date's format, have a look at format-date().
> Hope this helps!
>
> Best regards,
> Roman
>
> --------------------------
> Sent from my BlackBerry Wireless Device
>
> ----- Originalnachricht -----
> Von: www-xsl-fo-request@... <www-xsl-fo-request@...>
> An: www-xsl-fo@... <www-xsl-fo@...>
> Gesendet: Thu Apr 03 16:38:01 2008
> Betreff: Can I get current date and time XSL-FO??How???
>
>
> Hi dear Nabble staff,
> ....... i have a problem very difficult to solve for me....
> .....I have Oracle APEX Web developer to make a report in XSL-FO and to
> translate it into PDF and i want to customize reports made by APEX.
>
> I tried to get current date and/or time in XSL-FO file but I can't to find
> a
> solution for this....
>
> I tried to create customized functions made with Javascript, msxsl code
> and
> with XSQL but nothing....
>
> this is my XSL-FO code......tell me what i should write and
> where!!!...thanks
>
> <?xml version = '1.0' encoding = 'utf-8'?>
> <xsl:stylesheet version="2.0"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"                
> xmlns:xlink="http://www.w3.org/1999/xlink">
> <xsl:output method="html" />
>
> ......
>    <xsl:attribute-set name="page-number">
>       <xsl:attribute name="height">13.872pt</xsl:attribute>
>    </xsl:attribute-set>
>    <xsl:attribute-set name="header-font">
>
>      .....
>
>    <xsl:template match="/">
>       <fo:root>
>          <fo:layout-master-set>
>             <fo:simple-page-master master-name="master0"
> margin-left="66.6pt" margin-right="66.6pt" page-height="#PAGE_HEIGHT#pt"
> page-width="#PAGE_WIDTH#pt" margin-top="36.0pt" margin-bottom="36.0pt">
>                  ........
> </fo:block>                  
> <fo:block>
>    Page  <fo:page-number/>
> </fo:block>
> <fo:block text-align="right">
> <fo:external-graphic
> src="http://www.fiddlersgreen.net/AC/aircraft/Caproni-Stipa/IMAGES/Stipa-Caproni-cartoon.jpg"
> />
> </fo:block>
> <fo:block text-align="center">
> STIPA bla bla bla bla bla bla
> </fo:block>
> <fo:block text-align="center">
> STIPA bla bla bla bla bla bla
> </fo:block>
>              ....
>
>    </xsl:template>
> </xsl:stylesheet>
> --
> View this message in context:
> http://www.nabble.com/Can-I-get-current-date-and-time-XSL-FO--How----tp16467521p16467521.html
> Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
>
>
>
>
>

--
View this message in context: http://www.nabble.com/Can-I-get-current-date-and-time-XSL-FO--How----tp16467521p16490313.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.





Re: AW: Can I get current date and time XSL-FO??How???

by Tony Graham-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Fri, Apr 04 2008 10:51:17 +0100, emanuele.picciani1@... wrote:

> Thanks for your sentence......I tried this but i can't display PDF output
> file(i tried to display it also with WORD and HTML)......
>
> i add this part of code
> ......
> <fo:block>
> <xsl:value-of select="current-date()" />  (i used also current-dateTime())
> </fo:block>
>
> .......but
> .......with WORD and HTML  i have a blank page while with PDF I have an error
> message that says:
> "the file cannot be opened because it's a file not supported or it may be
> damaged!"

Were you able to get usable output before you added the use of the
function?

Regards,


Tony Graham.
======================================================================
Tony.Graham@...   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================


Re: AW: Can I get current date and time XSL-FO??How???

by manl799 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Tony Graham-3 wrote:

Were you able to get usable output before you added the use of the
function?

Regards,


Tony Graham.
======================================================================
Tony.Graham@MenteithConsulting.com   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================


emanuele wrote:
Yes.....I was able to open output file with PDF,WORD and HTML........
.....with that code the problem starts to exist...


Regards
Emanuele

Re: AW: Can I get current date and time XSL-FO??How???

by Tony Graham-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Fri, Apr 04 2008 21:47:10 +0100, emanuele.picciani1@... wrote:
> Tony Graham-3 wrote:
>> Were you able to get usable output before you added the use of the
>> function?
...
> emanuele wrote:
>>
>> Yes.....I was able to open output file with PDF,WORD and HTML........
>> .....with that code the problem starts to exist...

It may be that you also need to use format-time() [1].

Does Oracle Apex Developer give any error messages?

Are you able to run the transform using a command-line XSLT processor
and look at its output to see what you are feeding to the FO processor?

Regards,


Tony Graham.
======================================================================
Tony.Graham@...   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================

[1] http://www.w3.org/TR/xslt20/#date-time-examples


Re: AW: Can I get current date and time XSL-FO??How???

by manl799 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Tony Graham-3 wrote:
On Fri, Apr 04 2008 21:47:10 +0100, emanuele.picciani1@virgilio.it wrote:
> Tony Graham-3 wrote:
>> Were you able to get usable output before you added the use of the
>> function?
...
> emanuele wrote:
>>
>> Yes.....I was able to open output file with PDF,WORD and HTML........
>> .....with that code the problem starts to exist...

It may be that you also need to use format-time() [1].

Does Oracle Apex Developer give any error messages?

Are you able to run the transform using a command-line XSLT processor
and look at its output to see what you are feeding to the FO processor?

Regards,


Tony Graham.
======================================================================
Tony.Graham@MenteithConsulting.com   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================

[1] http://www.w3.org/TR/xslt20/#date-time-examples




I'm not able to run a command-line XSLT tester, but i can say that i tried the same XSL-FO code into Stylus Studio and it's ok....==>i have set Saxon XSLT processor in Stylus Studio

Regards
Emanuel