A problem with [embedded templates???]

Subject: A problem with [embedded templates???]
From: "Hunter, David" <dhunter@xxxxxxxxxxxx>
Date: Wed, 29 Sep 1999 11:44:13 -0400
I'm not even sure how to properly phrase my question, but suppose I have XML
similar to the following:

<slide previous='slide0.xml' next='slide2.xml'>
	<title>Slide Using Bullets</title>
	<bullets>
		<b>Text for the first bullet</b>
		<b>
			Text for the second bullet
				<sb>text for the first sub-bullet</sb>
		</b>
		<b>Text for the third bullet</b>
	</bullets>
</slide>

(Yes, I too am developing an XSL "slideshow presenter", although it won't be
nearly as powerful as some of the others that are being developed.  It will
only be used as a QAD learning tool when I give XML presentations in the
future.)

I have an XSL stylesheet to format those <b/> tags as bullets, and <sb/>
tags as sub bullets, like the following:

-Text for the first bullet
-Text for the second bullet
	-text for the first sub-bullet
-Text for the third bullet

Pasted below is the relevant section of my stylesheet:

<xsl:template match="bullets">
  <ul><xsl:apply-templates select="b"/></ul>
</xsl:template>

<xsl:template match="b">
  <li><xsl:value-of select="text()"/></li>
  <xsl:if test="sb"><ul><xsl:apply-templates select="sb"/></ul></xsl:if>
</xsl:template>
  
<xsl:template match="sb">
  <li><xsl:value-of select="text()"/></li>
</xsl:template>

Everything works fine as is, but my problem is that I can't figure out how
to define an <underline/> element for my slideshow XML, to underline text.
So, for example, I would be able to write <b>Text for the
<underline>first</underline> bullet</b>, and produce the bulleted list
above, but with the word "first" underlined.

Creating the template for the <underline/> element itself is extraordinarily
easy, but getting the results to appear in the proper place in the output is
stumping me bigtime.  (The closest I've been able to get is to output "Text
for the first", where the word "first" is underlined, but the rest of the
text is cut off.)

If this is a FAQ, then apologies for the long post, and could you please
point me there?  :-)  If not, any suggestions would be welcome, or any
suggestions on a better way to format my bullets would also be welcome.
(I'm using the IE5 implementation of XSL.)  If there is any interest, I'd be
willing to post my finished results to the list later.  (There are basically
4 elements:  a CSS stylesheet (which I suppose is optional), an HTML file
which does all of the work, and displays the slides in a <div/>, an XSL
stylesheet, and the XML files for each slide.)

David Hunter
david.hunter@xxxxxxxxxxxxx
MediaServ Information Architects
http://www.MediaServ.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread