[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Generating ODF

Subject: Re: Generating ODF
From: Michael B Allen <mba2000@xxxxxxxxxx>
Date: Tue, 13 Mar 2007 23:59:00 -0400
Re:  Generating ODF
On Tue, 13 Mar 2007 23:00:19 -0400
Michael B Allen <mba2000@xxxxxxxxxx> wrote:

> <text:p text:style-name="Code_20_Sample"><text:s text:c="4"/>'scope' =&gt; '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(., '&#10;')">
        <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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.