Re: [xsl] WordML to XML/HTML

Subject: Re: [xsl] WordML to XML/HTML
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Sat, 05 Feb 2005 12:12:36 +0100
Tempore 10:19:45, die 02/05/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Joris Gillis <roac@xxxxxxxxxx>:

You'll get this output:
		<b>I have bold and italics and underscore

You might also use inline CSS styling.
The construction of the 'style' attribute might be easier to comprehend than the recursive element creation method.

to get this output:

<span style="font-style: italic;text-decoration: underline;font-weight: bold;">I have bold and italics and underscore</span>

You can use an XSLT like this:

<xsl:stylesheet xmlns:xsl=""; version="1.0" xmlns:w="specify-the-namespace-here" exclude-result-prefixes="w">
<xsl:output method="xml"/>

<xsl:template match="w:r">
	<xsl:apply-templates select="w:t"/>

<xsl:template match="w:t">
		<xsl:apply-templates select="../w:rPr"/>

<xsl:template match="w:rPr">
	<xsl:attribute name="style">

<xsl:template match="w:u">text-decoration: underline;</xsl:template>
<xsl:template match="w:b">font-weight: bold;</xsl:template>
<xsl:template match="w:i">font-style: italic;</xsl:template>


regards, -- Joris Gillis ( Veni, vidi, wiki (

Current Thread