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

Re: Converting WordML to a XHTML list

Subject: Re: Converting WordML to a XHTML list
From: "cking" <cking@xxxxxxxxxx>
Date: Wed, 25 Aug 2004 10:05:59 +0200
wordml stylesheet
Hi Lincoln,

Now I see what your problem is. 

<xsl:when test="w:pPr/w:listPr">
   <!-- match 1st w:r/w:t put in <ol> -->
   <xsl:apply-templates select="w:r/w:t"/>
   <!-- match last w:r/w:t put in </ol> -->
</xsl:when>

This will not be possible, as it would produce invalid XML.
So, you will need to use another logic...

I'm not familiar with WordML, so I have no idea how the rest of the input file
is organized. Would it be possible to send a complete input file + stylesheet?
(if the files are too large to post, you can send them to me off-list)

To take only the <w:t> elements that are related to a list item,
you could do something like this:

    ...
    <xsl:variable name="list-items" select="//w:t[../../w:pPr/w:listPr]"/>
    <xsl:if test="count($list-items) > 0">
        <ol><xsl:apply-templates select="$list-items" mode="li"/></ol>
    </xsl:if>
    ...

<xsl:template match="w:t" mode="li">
    <li><xsl:value-of select="."/></li>
</xsl:template>

Best regards,
Anton Triest


Wednesday, August 25, 2004 1:09 AM, Lincoln Mitchell wrote:
>
> Hi Anton,
> That will not work in this instance. In my xsl(cutdown version) below you
> can see I 1st match a w:p and there are multiple instances of w:t not
> related to a list item.
> 
> TIA
> Linc
> 
> ...
> <xsl:template match="w:p">
> <xsl:choose>
> <xsl:when test="w:pPr/w:pStyle/@w:val='Heading5'"> 
> <h2>
> <xsl:apply-templates
> select="w:r/w:t"/>
> </h2>
> </xsl:when>
> ...
> <xsl:when test="w:pPr/w:listPr">
> <!-- match 1st w:r/w:t put in <ol> -->
> <xsl:apply-templates
> select="w:r/w:t"/>
> <!-- match last w:r/w:t put in </ol> -->
> </xsl:when>
> <xsl:otherwise>
> <p>
> <xsl:apply-templates
> select="w:r/w:t"/>
> </p>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
> ...

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.