Altova Mailing List Archives

[xsl] spacing issue

From: Spencer Tickner <spencertickner@--------->
Date: 6/3/2005 10:01:00 PM
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:


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
	<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

<xsl:template match="subsectionnumber">

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

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

Sample xml

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


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.


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>


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


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.



These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.