[XML-SIG] XSLT and anchor tag indentation problem

sag at hydrosphere.com sag at hydrosphere.com
Fri Jan 30 17:03:35 EST 2004


I am using Python 2.2.1 on Red Hat 8.  I have a python module that 
uses the cgitb XSLT processor to apply an XSLT transformation to an 
XML page to create an HTML page.

Part of the HTML output must be tab-delimited values, so I must use 
the <pre> tags to preserve the tabs in the data.  The data are a long 
list of measurements and their dates.  I want an anchor at each 
section that starts a new year.  I keep getting unexpected new lines 
and space characters whenever I put in the anchor section.

As an example of what is happening,  create a simple XSLT with html 
output, with the following entry.

<xsl:text>Line 1</xsl:text>
<a href='A '/><a href='B' /><a href='C' />

My output as viewed in source of browser is
Line 1
 <a href='A' />
 <a href='B' />
 <a href='C' />
(note leading space before the anchors, and they are on their own 
lines)

However, if the entry is
<xsl:text>Line 1</xsl:text>
<a href='A ' /><xsl:text>T</xsl:text><a href='B' />

the output is
Line 1
 <a href='A' />T<a href='B' />U<a href='C'/>
(note the new line and leading blank for the first anchor, but not 
before the second one). 

You must have some char in the <text> section - an empty 
<text></text> segment doesn't remove the NL and space behavior.  
Also, puttng in another HTML tag, such as <br> doesn't prevent the 
newline either.

I don't want the newline and indented space from the first case in my 
<pre> section, since it messes up the display of the data.

Is this a bug in the processor?  Does anyone know how I can get the 
output to all be on one line?

I am not on the list, so please email replies to sag at hydrosphere.com

Thanks

sue




More information about the XML-SIG mailing list