You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Skladov, Victor" <Sk...@his.de> on 2001/11/12 12:06:20 UTC

Cocoon2:XSP->Excel?

Hi, people!

Does anydody have expirience in creating EXCEL-Tables with XSP?
What must I do to get a true EXCEL Table from a XSP and XSL?

Thanks in advance
Viktor

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2:XSP->Excel?

Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
Alex Vishnev wrote:

>Marcelo,
>
>What is dbprism? Is this your software? If Not, can you reply with URL to
>it.  Where can I find dbprism/excel.xsl?
>
>
>TIA
>Alex
>
>
>
>
  DB Prism is at plenix web site:

http://www.plenix.com/dbprism/

  At this moment this site do not include excel.xsl because is a new 
files wich came with 2.0.0-alpha version to be released this week.
  I attached this file.
  Best regards, Marcelo.

PD: DB Prism 2.0.0 is working with Cocoon 2.0.0rc2 release and it works 
as a Custom Generator (db generator) generating the XML in the database 
side.

-- 
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431




RE: Cocoon2:XSP->Excel?

Posted by Alex Vishnev <av...@optonline.net>.
Marcelo,

What is dbprism? Is this your software? If Not, can you reply with URL to
it.  Where can I find dbprism/excel.xsl?


TIA
Alex



-----Original Message-----
From: Marcelo F. Ochoa [mailto:mochoa@ieee.org]
Sent: Monday, November 12, 2001 7:18 PM
To: cocoon-users@xml.apache.org
Subject: Re: Cocoon2:XSP->Excel?

Skladov, Victor wrote:

>Hi, people!
>
>Does anydody have expirience in creating EXCEL-Tables with XSP?
>What must I do to get a true EXCEL Table from a XSP and XSL?
>
>Thanks in advance
>Viktor
>
  To returns Excel files from Cocoon 2 there is a simple trick:
  If you returns from your XSP an XML like this:

<?xml version='1.0' encoding='iso-8859-1'?>
<ROWSET>
<ROW empno="1">
<name>Velasquez</name>
<job>President</job>
<sal>2500</sal>
</ROW>
<ROW empno="2">
<name>Ngao</name>
<job>VP, Operations</job>
<sal>1450</sal>
</ROW>
<ROW empno="3">
<name>Nagayama</name>
<job>VP, Sales</job>
<sal>1400</sal>
</ROW>
......
</ROWSET>

 And transform it with an stylesheet like this:
<?xml version="1.0"?>
<!-- Written by Marcelo F. Ochoa "mochoa@ieee.org" -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
   <html>
    <table>
       <tr><th>Emp Number</th><th>Name</th><th>Job</th><th>Sal</th></tr>
           <xsl:for-each select="ROWSET/ROW">
              <xsl:sort select="sal"
                          data-type="number"
                          order="ascending"/>
          <tr>
                <td><xsl:value-of select="@empno"/></td>
                <td><xsl:value-of select="name"/></td>
                <td><xsl:value-of select="job"/></td>
                <td><xsl:value-of select="sal"/></td>
          </tr>
           </xsl:for-each>
    </table>
   </html>
  </xsl:template>
</xsl:stylesheet>

  and finally adding this definitions into sitemap.xmap

   <map:serializer name="excel"  mime-type="application/vnd.ms-excel"
src="org.apache.cocoon.serialization.XMLSerializer">
    <encoding>iso-8859-1</encoding>
   </map:serializer>

   <map:match pattern="xmlj/DEMOj.excel">
    <map:generate type="serverpages" src="/xmlj/DEMOj.xsp"/>
    <map:transform src="stylesheets/dbprism/excel.xsl"/>
    <map:serialize type="excel"/>
   </map:match>

  and that's all.
  You could see this demo on-line at:
http://cocodrilo.exa.unicen.edu.ar:7777/dbprism/xmlj/DEMOj.excel
  Best regards, Marcelo.

--
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2:XSP->Excel?

Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
Skladov, Victor wrote:

>Hi, people!
>
>Does anydody have expirience in creating EXCEL-Tables with XSP?
>What must I do to get a true EXCEL Table from a XSP and XSL?
>
>Thanks in advance
>Viktor
>
  To returns Excel files from Cocoon 2 there is a simple trick:
  If you returns from your XSP an XML like this:

<?xml version='1.0' encoding='iso-8859-1'?>
<ROWSET>
<ROW empno="1">
<name>Velasquez</name>
<job>President</job>
<sal>2500</sal>
</ROW>
<ROW empno="2">
<name>Ngao</name>
<job>VP, Operations</job>
<sal>1450</sal>
</ROW>
<ROW empno="3">
<name>Nagayama</name>
<job>VP, Sales</job>
<sal>1400</sal> 
</ROW>
......
</ROWSET>

 And transform it with an stylesheet like this:
<?xml version="1.0"?>
<!-- Written by Marcelo F. Ochoa "mochoa@ieee.org" -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
   <html>
    <table>
       <tr><th>Emp Number</th><th>Name</th><th>Job</th><th>Sal</th></tr>
           <xsl:for-each select="ROWSET/ROW">
              <xsl:sort select="sal"
                          data-type="number"
                          order="ascending"/>
          <tr>
                <td><xsl:value-of select="@empno"/></td>
                <td><xsl:value-of select="name"/></td>
                <td><xsl:value-of select="job"/></td>
                <td><xsl:value-of select="sal"/></td>
          </tr>
           </xsl:for-each>
    </table>
   </html>
  </xsl:template>
</xsl:stylesheet>

  and finally adding this definitions into sitemap.xmap

   <map:serializer name="excel"  mime-type="application/vnd.ms-excel"  
src="org.apache.cocoon.serialization.XMLSerializer">
    <encoding>iso-8859-1</encoding>
   </map:serializer>

   <map:match pattern="xmlj/DEMOj.excel">
    <map:generate type="serverpages" src="/xmlj/DEMOj.xsp"/>
    <map:transform src="stylesheets/dbprism/excel.xsl"/>
    <map:serialize type="excel"/>
   </map:match>

  and that's all.
  You could see this demo on-line at:
http://cocodrilo.exa.unicen.edu.ar:7777/dbprism/xmlj/DEMOj.excel
  Best regards, Marcelo.

-- 
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Cocoon2:XSP->Excel?

Posted by Bernard D'Have <bd...@wanadoo.be>.
see http://poi.sourceforge.net

Bernard

> -----Original Message-----
> From: Skladov, Victor [mailto:Skladov@his.de]
> Sent: Monday, 12 November, 2001 12:06
> To: cocoon-users@xml.apache.org
> Subject: Cocoon2:XSP->Excel?
> 
> 
> Hi, people!
> 
> Does anydody have expirience in creating EXCEL-Tables with XSP?
> What must I do to get a true EXCEL Table from a XSP and XSL?
> 
> Thanks in advance
> Viktor
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2:XSP->Excel?

Posted by David Rosenstrauch <da...@dti.net>.
One possibility:  you can output the result as .csv (comma delimited) format.  Excel can read that.

Just output the result as text, with an extension of .csv, and when you write the result, put commas between the columns.


DR


At 12:06 PM 11/12/01 +0100, you wrote:
>Hi, people!
>
>Does anydody have expirience in creating EXCEL-Tables with XSP?
>What must I do to get a true EXCEL Table from a XSP and XSL?
>
>Thanks in advance
>Viktor
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org> 


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>