On Tue, 13 Mar 2007 23:00:19 -0400
Michael B Allen <mba2000(_at_)ioplex(_dot_)com> wrote:
<text:p text:style-name="Code_20_Sample"><text:s text:c="4"/>'scope' =>
'sub',</text:p>
<snip>
There several hurdles in generating this.
1. Every line is text:p tagged separately
2. Indenting is represented using text:s tags.
Well that wasn't too bad:
<xsl:template match="pre">
<xsl:for-each select="str:tokenize(., ' ')">
<xsl:variable name="norm"
select="normalize-space(.)"/>
<xsl:variable name="sp-count"
select="string-length(substring-before(.,substring($norm,1,1)))"/>
<text:p text:style-name="Code_20_Sample">
<xsl:element name="text:s">
<xsl:attribute name="text:c">
<xsl:value-of select="$sp-count"/>
</xsl:attribute>
</xsl:element>
<xsl:value-of select="$norm"/>
</text:p><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
But I'd still be interested in hearing other people's experiences
generating ODF.
Now on to tables ...
Mike
--
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--