|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fwd: Re: WordML to XML
Tempore 07:26:48, die 02/16/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Vasu Nanjangud
<vasdeep@xxxxxxxxx>:
Hi, Here is a stylesheet that will do the rudimentary operations to ouput an html lists up to arbitrary level. No distinction is made between numbering forms; I don't feel like unraffling the meaning those list definition elements.;) I you want to include different numbering styles, I advise you to use 'style' attributes and let the XSLT build a css section in your html that will take care of the styling. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" exclude-result-prefixes="w"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:key name="list" match="w:listPr" use="generate-id(ancestor::w:p/preceding-sibling::w:p/w:pPr/w:listPr[number(current()/w:ilvl/@w:val) - number(w:ilvl/@w:val)=1])"/> <xsl:template match="*[w:p/w:pPr/w:listPr]"> <ol> <xsl:apply-templates select="w:p[w:pPr/w:listPr/w:ilvl/@w:val='0']"/> </ol> </xsl:template> <xsl:template match="w:p"> <xsl:apply-templates select="(w:pPr|w:r)[1]" mode="styling"/> </xsl:template> <xsl:template match="w:pPr" mode="styling"> <xsl:apply-templates select="w:listPr" mode="styling"/> </xsl:template> <xsl:template match="w:listPr" mode="styling"> <li> <xsl:apply-templates select="../../w:r" mode="styling"/> <xsl:if test="key('list',generate-id())"> <ol> <xsl:apply-templates select="key('list',generate-id())" mode="styling"/> </ol> </xsl:if> </li> </xsl:template> </xsl:stylesheet> Btw, you should not have included entire files; snippets would have been OK. regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) "CB&CB9CB;CB.CB:CB?CB?CB= CB5CB9CB=CB1CB9 CB<CB1CB;CB;CB?CB= CB7 Cb CB9CB;CECB;CB1CB;CB?CB=" - CE!CB;CB5CECB2CB?Cb&CB;CB?Cb
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








