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

Preserving output formatting after XSL transformation

Subject: Preserving output formatting after XSL transformation
From: "Jesse Ehrenzweig" <jesse@xxxxxxxxxxx>
Date: Wed, 8 Nov 2000 13:09:56 -0500
xsl output formatting
I'm wondering how to preserve the formatting of my transformed HTML output
text.... instead of text appearing like so:

	<table>
	<tr>
	<td>
	....

I would like it to appear like this instead:

	<table>
		<tr>
			<td>
				...

Attached is a copy of my XSL document, and a sample piece of XML code.  Any
help, advice or links would be greatly appreciated!


-=Tek Boy=-

*****************************************************************

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:space="preserve">
<xsl:output method="html" version="3.2" indent="yes"/>

<xsl:template match="PROMOTIONS">
    <xsl:for-each select="PROMOTION[position() mod 3 = 1]" >
<center>
<table cellpadding="5" cellspacing="5" border="1">
  <tr>
      <xsl:for-each select="self::PROMOTION |
following-sibling::PROMOTION[position() &lt; 3]">
    <td><img>
        <xsl:attribute name="src"><xsl:value-of
select="IMAGE_URL"/></xsl:attribute>
        <xsl:attribute name="border">0</xsl:attribute>
    </img></td>
      </xsl:for-each>
  </tr>
</table>
</center>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>

*****************************************************************

<?xml version="1.0"?>

<PROMOTIONS>
  <PROMOTION>
    <ID>6606</ID>
    <SHORT_TITLE>Buy 10 Gerber 1st Foods (2.5oz) get $1.00
off.</SHORT_TITLE>
    <FULL_TITLE>Buy 10, get US$ 1 discount.</FULL_TITLE>

<IMAGE_URL>http://oc-dev-01/resources/issuer/promotions/images/10/1/1st_food
s_1d_10_2pt5oz.gif</IMAGE_URL>
  </PROMOTION>
  <PROMOTION>
    <ID>6545</ID>
    <SHORT_TITLE>Buy 3 Ben &amp; Jerry Ice Cream get $2.00 off</SHORT_TITLE>
    <FULL_TITLE>Buy 3, get US$ 2.00 discount.</FULL_TITLE>

<IMAGE_URL>http://oc-dev-01/resources/issuer/promotions/images/10000/1/b3_ge
t_2d.gif</IMAGE_URL>
  </PROMOTION>
</PROMOTIONS>

*****************************************************************


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.