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

Re: Formatting issue with HTML and TEXT output method

Subject: Re: Formatting issue with HTML and TEXT output method
From: "Senthilkumaravelan K" <skumaravelan@xxxxxxxxxxxxxx>
Date: Thu, 17 Jul 2008 09:50:32 -0700
 Re: Formatting issue with HTML and TEXT output method
Hi ,
Here is my sample xslt and xml .
html.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="no" indent="yes"/>

<xsl:template match="/content">
	<xsl:copy>
		<xsl:apply-templates/>
	</xsl:copy>
</xsl:template>

<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
</head>
<body>
<table width="100%"  valign="top">
<tr>
<td colspan="2" style="text-align:justify;">
<xsl:value-of select="//name"/>
</td></tr>
<tr>
<td colspan="2" style="text-align:justify;">
<xsl:copy-of select="//cond"/></td></tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

text.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8" />

<xsl:template match="/content">
	<xsl:copy>
		<xsl:apply-templates />
	</xsl:copy>
</xsl:template>
<xsl:template match="/">
NAME <xsl:value-of select="//name"/>
<xsl:copy-of select="//cond"/>
</xsl:template>
</xsl:stylesheet>


content.xml


<content>
<name>
Senthil
</name>
<cond>
<html>
<body>
<p align="center">
TESTTESTTESTTESTTESTTESTTESTTESTTEST
TESTTESTTESTTESTTESTTESTTESTTESTTEST
TESTTESTTESTTESTTESTTESTTESTTESTTEST
</p>
<p align="center">
TESTTESTTESTTESTTESTTESTTESTTESTTEST
TESTTESTTESTTESTTESTTESTTESTTESTTEST
TESTTESTTESTTESTTESTTESTTESTTESTTEST
</p>
</body>
</html>
</cond>
</content>


Thanks,
Senthil

On Wed, Jul 16, 2008 at 4:38 PM, Senthilkumaravelan K
<skumaravelan@xxxxxxxxxxxxxx> wrote:
> Hi All,
> We have xml
> <note>
> <cond>
> <html>
> <body>
> <p align="center">
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> </p>
> <p align="center">
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> TESTTESTTESTTESTTESTTESTTESTTESTTEST
> </p>
> </body>
> </html>
> </cond>
> <note>
>
> When we write xslt one with "html" as output method and text as output method.
>
> for html out method am using
> <xsl:value-of select="//cond">
>
> text output method
> <xsl:copy-of select="//cond">
>
>
> How to make the text xslt output like formatted text output pretty
> with alignment.
>
> Any idea would of great help.
>
> Thanks
> Senthil

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.