[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: WordML to XML/HTML
Tempore 10:19:45, die 02/05/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Joris Gillis <roac@xxxxxxxxxx>:
You'll get this output: <i> <u> <b>I have bold and italics and underscore </b> </u> </i> 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="http://www.w3.org/1999/XSL/Transform" 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> <xsl:template match="w:t"> <span> <xsl:apply-templates select="../w:rPr"/> <xsl:apply-templates/> </span> </xsl:template> <xsl:template match="w:rPr"> <xsl:attribute name="style"> <xsl:apply-templates/> </xsl:attribute> </xsl:template> <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> </xsl:stylesheet>
|
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
|