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

spacing issue

Subject: spacing issue
From: Spencer Tickner <spencertickner@xxxxxxxxx>
Date: Fri, 3 Jun 2005 15:00:09 -0700
xsl spacing
Hi everyone, thank you all in advance for the help,

I am getting strange spaces in my output. A sample of my code is below:

XSLT

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" indent="yes" omit-xml-declaration="yes"
encoding="ISO-8859-1" name="html"/>

<xsl:template match="/">
	<p class="sub">(<xsl:apply-templates
select="subsectionnumber"/>)&#xA0; <xsl:apply-templates
select="subsectiontext"/></p>
</xsl:template>

<xsl:template match="subsectionnumber">
	<xsl:apply-templates
select="text()|strong|a|graphic|em|sup|sub|u|insert|br|eacute|hr"/>
</xsl:template>

<xsl:template match="text()">
	<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="insert">
	<p class="insert"><xsl:apply-templates/></p>
</xsl:template>

Sample xml

<subsectionnumber><insert>2</insert></subsectionnumber>
<subsectiontext>Here is some text for subsection 2</subsectiontext>

Output.

Without the insert tags in the above line everything is sweet as some
kind of sweet candy. However with insert in the xml (and any other
inline element) I get spaces around my subsectionnumber.

Example

Without <insert>

<p class="sub">(2)&nbsp; A bylaw passed by the board may be repealed,</p>

With <insert>

<p class="para">(

        <insert><span class="insert">t.1</span></insert>

          				)
     			&nbsp;

            <insert><span class="insert">granting authorization to
members</span></insert>

         </p>


What I need?

Ok, so the code is ugly, I for one am not a stickler for beautifully
formatted code, however  I have to get rid of the extra space put in
by the browser for the carriage returns. ie ( t.1 ).

Any help would be great.

Spencer

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.