cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Bagby <willi...@adone.com>
Subject RE: Transforming XML ito open in Excel
Date Thu, 01 Mar 2001 21:19:39 GMT
That is awesome.

Is there a way to make it so that the fields in the first row become the
column names? I am of course making a big assumption that this can be done,
because when you import tab-delimited files in Excel you have that option.

Is there some type of API for this?

William Bagby

> -----Original Message-----
> From: Marcelo Ochoa [mailto:mochoa@ieee.org]
> Sent: Thursday, March 01, 2001 1:31 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: Transforming XML ito open in Excel
> 
> 
> Hi Carl:
>   You are right.
>   Here an example the lines added to the cocoon.properties 
> configurations
> file:
> 
> formatter.type.application/vnd.ms-excel =
> org.apache.cocoon.formatter.TextFormatter
> formatter.application/vnd.ms-excel.MIME-type = 
> application/vnd.ms-excel
> 
>   And here an stylesheet which produce the correct output:
> 
> <?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="/">
>    <xsl:processing-instruction
> name="cocoon-format">type="application/vnd.ms-excel"</xsl:proc
> essing-ins
> truction>
>    <html>
>            <xsl:for-each select="sales/name">
>                 <xsl:sort select="point"
>                           data-type="number"
>                           order="ascending"/>
>                 <xsl:value-of select="@id"/><xsl:text>  </xsl:text>
>                 <xsl:value-of select="city"/><xsl:text> </xsl:text>
>                 <xsl:value-of select="point"/><xsl:text>      
>   </xsl:text>
>                 <xsl:value-of select="stock"/><xsl:text>      
>   </xsl:text>
>                 <xsl:text>
> </xsl:text>
>            </xsl:for-each>
>    </html>
>   </xsl:template>
> 
> </xsl:stylesheet>
> 
>    This stylesheet makes a tab separated field, one row per 
> line, which
> is automatically converted by Excel in an spreadsheet.
>    Best regards, Marcelo.
> 
> PD: Here the demo on line:
> http://cocodrilo.exa.unicen.edu.ar:7777/servlets/xml/demo.xmle
xcel?produ
cer=db

--
Do you know DB Prism look @ http://www.plenix.com/dbprism/
More info?
- Chapter 21 "Profesional XML Databases" at Wrox Press
(http://www.wrox.com/)
- Chapter 8 "Oracle & Open Source" by O'Reilly (http://www.oreilly.com/)
Marcelo F. Ochoa
Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Univ.
(7000) Tandil - AR
Tel.: +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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message