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

RE: Whitespace after <span> in <a>

Subject: RE: Whitespace after <span> in <a>
From: "William BC Crandall" <bc.crandall@xxxxxxxxxxxxx>
Date: Wed, 16 Jul 2003 20:09:33 -0700
span white space
Greetings,

I'm using Xalan 2.3.1 to transform xml text files into xhtml.

I use two link tags, one for local, in-site links and another for
outside links ("olink"). Each olink is given a footnote number, in
square brackets, in running text. A link, with the "name" I've given
it, is provided in end notes that point to documents outside the site.
Inline, I use a <span> to provide a handle for CSS formatting of the
"inlineNoteNumber".

The system I've built works fine, with an irritating anomaly. The
generated html document always contains a carriage return and a number
of spaces after the note number in running text. When viewed in a
browser, these show as a single space. If punctuation follows the
number, we have unsightly space that I would like to get rid of.

I've experimented with xsl:text and xsl:strip-space, but to no avail.


Example xml source:

  <olink
  url="http://www.counterbalance.net/biogloss/totistem-body.html"
  name="Totipotent Stem Cells" ref="totiDef03">Totipotent stem
  cells</olink> of human beings ...


The relevant xsl:

  <!-- olink -->
  <!-- link to eom; non-breaking space 160; insert note number -->
  <xsl:template match="olink">
    <a href="#{@ref}">
      <xsl:apply-templates />
      <span class="inlineNoteNumber">&#160;[<xsl:number level="any"
/>]</span></a>
  </xsl:template>


Resulting html:

  <a href="#totiDef03">Totipotent stem
      cells<span class="inlineNoteNumber">Â [14]</span>
                  </a> of human beings...



(The "Â" is another anomaly that I'd like to resolve; it should be
passed through as &#160; or &nbsp; that would pass validation, but
that's another issue.)

Thanks in advance for any suggestions.

William BC Crandall
Post Office Box 187
Lagunitas, CA 94938
bc.crandall@xxxxxxxxxxxxx


 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.