[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: WordML to XML/HTML

Subject: Re: WordML to XML/HTML
From: Vasu Nanjangud <vasdeep@xxxxxxxxx>
Date: Sat, 5 Feb 2005 22:30:39 -0800 (PST)
wordml bold
Thanks Joris for the help!

Regards,
Vasu

Subject: Re:  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:
<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>


regards,
--
Joris Gillis
(http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Veni, vidi, wiki (http://www.wikipedia.org)



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

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.