Subject: Re: [xsl] WordML to XML/HTML From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Sat, 05 Feb 2005 10:19:45 +0100 |
Hi,I have WordML data like this... <w:r> <w:rPr> <w:i> <w:u w:val="single"/> <w:b/> </w:rPr> <w:t>I have bold and italics and underscore </w:t> </w:r>
starting from this xml: <w:r xmlns:w="specify-the-namespace-here"> <w:rPr> <w:i/> <w:u w:val="single"/> <w:b/> </w:rPr> <w:t>I have bold and italics and underscore </w:t> </w:r>
You'll get this output: <i> <u> <b>I have bold and italics and underscore </b> </u> </i>
<xsl:template match="w:r "> <xsl:apply-templates select="(w:rPr|w:t)[1]"/> </xsl:template>
<xsl:template match="w:rPr"> <xsl:apply-templates select="*[1]"/> </xsl:template>
<xsl:template match="w:rPr/*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="(following-sibling::*|../../w:t)[1]"/> </xsl:element> </xsl:template>
I hope this is useful I don't know wordML, so I can't guarantee this solution works in all cases.
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Veni, vidi, wiki (http://www.wikipedia.org)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] WordML to XML/HTML, Touchtel | Thread | Re: [xsl] WordML to XML/HTML, Joris Gillis |
Re: [xsl] ANN: nxslt.exe (.NET XSLT, Dimitre Novatchev | Date | Re: [xsl] ANN: nxslt.exe (.NET XSLT, Oleg Tkachenko |
Month |