[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: "Lincoln Mitchell" <lincoln@xxxxxxxxxxx>
Date: Wed, 25 Aug 2004 07:09:59 +0800
lincoln mitchell
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>
...


-----Original Message-----
From: cking [mailto:cking@xxxxxxxxxx] 
Sent: Tuesday, 24 August 2004 6:59 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Converting WordML to a XHTML list

Hi Lincoln,

<xsl:if test="count(//w:t) > 0">
    <ul><xsl:apply-templates select="//w:t"/></ul> </xsl:if>

With your input, will produce a list like
    - item 1
    - item 2
    - item 3
and will produce nothing if there are no <w:t> elements

Does this help? If not, you will have to give us more information (what's
the stylesheet you have so far? what's your desired output?)

Best regards
Anton Triest


Tuesday, August 24, 2004 1:00 AM, Lincoln Mitchell wrote:
>
> I have the following WordML that I wish to turn into a XHTML list. I 
> can get the <li>'s but having trouble wrapping them in <ul>...</ul>.
> NOTE: <w:p> may or may not contain a list
> 
> ...
> <w:p>
> <w:pPr>
> <w:listPr>
> <w:ilvl w:val="0"/>
> <w:ilfo w:val="11"/>
> <wx:t wx:val="1." wx:wTabBefore="360"
> wx:wTabAfter="210"/>
> <wx:font wx:val="Times New Roman"/>
> </w:listPr>
> </w:pPr>
> <w:r>
> <w:t>item 1</w:t>
> </w:r>
> </w:p>
> <w:p>
> <w:pPr>
> <w:listPr>
> <w:ilvl w:val="0"/>
> <w:ilfo w:val="11"/>
> <wx:t wx:val="2." wx:wTabBefore="360"
> wx:wTabAfter="210"/>
> <wx:font wx:val="Times New Roman"/>
> </w:listPr>
> </w:pPr>
> <w:r>
> <w:t>item 2</w:t>
> </w:r>
> </w:p>
> <w:p>
> <w:pPr>
> <w:listPr>
> <w:ilvl w:val="0"/>
> <w:ilfo w:val="11"/>
> <wx:t wx:val="3." wx:wTabBefore="360"
> wx:wTabAfter="210"/>
> <wx:font wx:val="Times New Roman"/>
> </w:listPr>
> </w:pPr>
> <w:r>
> <w:t>item 3</w:t>
> </w:r>
> </w:p>
> ...
> 
> 
> Any clues?
> 
> 
> TIA
> Linc

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.