xsl-list
[Top] [All Lists]

Re: spacing issue

2005-06-06 09:04:34
Sorry David,

I think you may have been reading my post were I gave the html output,
basically the bad output in xsl comes from these 3 templates.

<!-- This handles the subsection,, a subsection is comprised of a
subsectionnumber and
 subsection text, each may have any number of inline elements -->
      <xsl:template match="subsection" mode="contentsection">
               <xsl:choose>
                       <xsl:when test="parent::section/sectiontext">
                               <p class="sub">(<xsl:apply-templates
select="subsectionnumber"/>)&#xA0; <xsl:apply-templates
select="subsectiontext"/></p>
                       </xsl:when>
                       <xsl:otherwise>
                               <xsl:if
test="not(count(preceding-sibling::*[name()=name(current())])+1
= 1)">
                                       <p class="sub">(<xsl:apply-templates
select="subsectionnumber"/>)&#xA0; <xsl:apply-templates
select="subsectiontext"/></p>
                               </xsl:if>
                       </xsl:otherwise>
               </xsl:choose>
       </xsl:template>

<!-- This is where we handle the subsectionnumber and subsectiontext
for the table of contents, contents and summary page, we basically
apply all inline styles that are allowed for subsectionnumbers and
sectiontext -->
<!--subsectionnumber -->
       <xsl:template match="subsectionnumber">
               <xsl:apply-templates
select="text()|strong|a|graphic|em|sup|sub|u|insert|br|eacute|hr"/>
       </xsl:template>
<!--subsectiontext -->
       <xsl:template match="subsectiontext">
               <xsl:apply-templates
select="text()|strong|a|graphic|em|sup|sub|u|insert|br|eacute|hr"/>
       </xsl:template>

<!-- Here is the insert Inline element. It places the content in green
text to dispaly to the customer that the text is new. it also wraps
the text in an <insert> tag that our content manager uses to index
that the text is considered "new" when performing searches. -->
<xsl:template match="insert"><xsl:element name="{name()}"><xsl:element
name="span"><xsl:attribute
name="class">insert</xsl:attribute><xsl:apply-templates/></xsl:element></xsl:element></xsl:template>

Ok, there ya go.

Cheers,

Spencer

On 6/6/05, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

  You lost me. The code I replied to had an ,insert explictly in teh
  template, i just added a template.


sorry that's garbled even for me.



You lost me. The code I replied to had an <insert> explictly in the
template, I just added an xsl:text.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>