This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Preserving output formatting after XSL transformation


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]