Hi!
Here's one, you can serach gnumeric to find relative art.
johnson
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0"
xmlns:gmr="http://www.gnome.org/gnumeric/v7"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
<xsl:template match="page">
<gmr:Workbook xmlns:gmr="http://www.gnome.org/gnumeric/v7">
<gmr:Sheets>
<gmr:Sheet DisplayFormulas="false" HideZero="false" HideGrid="false"
HideColHeader="false"
HideRowHeader="false" DisplayOutlines="true" OutlineSymbolsBelow="true"
OutlineSymbolsRight="true">
<gmr:Name>title</gmr:Name>
<gmr:MaxCol><xsl:value-of
select="count(/page/table/tr[1]/th)"/></gmr:MaxCol>
<gmr:Styles>
<gmr:StyleRegion startRow="0" endRow="0" startCol="0"
endCol="{count(/page/table/tr[1]/th) -1}">
<gmr:Style HAlign="8" VAlign="4" WrapText="0" Orient="1" Shade="0"
Indent="0" Locked="1" Hidden="0"
Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
<gmr:Font Unit="10" Bold="1" Italic="0" Underline="0" StrikeThrough="0">
Helvetica</gmr:Font>
</gmr:Style>
</gmr:StyleRegion>
</gmr:Styles>
<gmr:Cols DefaultSizePts="80">
</gmr:Cols>
<gmr:Rows DefaultSizePts="12.8">
<gmr:RowInfo No="0" Unit="18" MarginA="0" MarginB="0"/>
</gmr:Rows>
<gmr:Cells>
<xsl:apply-templates/>
</gmr:Cells>
</gmr:Sheet>
</gmr:Sheets>
</gmr:Workbook>
</xsl:template>
<xsl:template match="table">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tr">
<xsl:variable name="rownumber"><xsl:number level="any" from="table"
count="tr"/></xsl:variable>
<xsl:for-each select="./th">
<gmr:Cell Col="{position() - 1}" ValueType="60">
<xsl:attribute name="Row">
<xsl:value-of select="$rownumber -1"/>
</xsl:attribute>
<gmr:Content>
<i18n:text><xsl:value-of select="."/></i18n:text>
</gmr:Content>
</gmr:Cell>
</xsl:for-each>
<xsl:for-each select="./td">
<xsl:if test="string-length(normalize-space(shi)) = 0">
<gmr:Cell Col="{position() - 1}" ValueType="20">
<xsl:attribute name="Row">
<xsl:value-of select="$rownumber -1"/>
</xsl:attribute>
</gmr:Cell>
</xsl:if>
<xsl:if test="string-length(normalize-space(shi)) != 0">
<gmr:Cell Col="{position() - 1}" ValueType="60">
<xsl:attribute name="Row">
<xsl:value-of select="$rownumber -1"/>
</xsl:attribute>
<gmr:Content>
<i18n:text><xsl:value-of select="shi"/></i18n:text>
<xsl:if test="(ban = '2' or ban = '3') and normalize-space(shan)">?</xsl:if>
</gmr:Content>
</gmr:Cell>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
fast-flux
Hi All,
I am just beginner in cocoon. I have the following requirements:
1. I have input XML file
<Cars>
<Car>
<name>
Ferrari
</name>
<type>
Water
</type>
</Car>
<Car>
<name>
Mercedes
</name>
<type>
Air
</ type>
</Car>
</Cars>
2. I have a Excel template Which already has headers (Car Name & Car
Type)
Task for me is to use the XML as a source generater & serilize the
output using the predefined template.
I would appreciate if you could share any working example of such type.
I visited XML.com article ( http://www.xml.com/lpt/a/1096 ) and they have
no examples where we can take the input feed from XML and generate on a
Template. All example includes SQL and due to some freak problem, I am
still struggling to get the SQL part running.
Thanks in advance,
-Siddhu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]