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

Q: Inline HTML markup of nested XML elements with XSL

Subject: Q: Inline HTML markup of nested XML elements with XSL
From: "Glenn Cruickshank" <gc@xxxxxxxxxx>
Date: Fri, 29 Oct 1999 11:09:58 -0600
inline html
Probably a beginners question, but we were all once beginners....

Using the new IPTC/NAA NITF.DTD in IE5:

I'm trying to use the <em style=> method for doing bolds, italics, drop
caps, etc, and also mark <people> in the text.  Like this:

<p>    <em style="dropcap">W</em>all Street pros call all this backing and
filling a <em style="bold">"trading range,"</em> meaning that stocks trade
up and down but never leave a broad range. <person>Abby Joseph
Cohen</person>, the Goldman Sachs Group investment strategist whose optimism
has come to symbolize the great bull market of the 1990s, has begun warning
clients to expect the market to be more sluggish: <em style="italic"> "Stock
prices will be rising, but at a less exuberant pace," she says.</em></p>

With this style sheet:
<xsl:template match="em">
	  <xsl:choose>
    		<xsl:when test="@style[.='dropcap']">
		<SPAN STYLE="display:inline;font-family:tahoma,arial,sans-serif">
<FONT FACE="Arial Black" SIZE="8">
	     		<xsl:value-of select="." />
		</FONT>
		</SPAN>
	    	</xsl:when>

	    	<xsl:when test="@style[.='bold']">
			<SPAN STYLE="display:inline">
			<B>
	     		<xsl:value-of select="."/>
			</B></SPAN>
    		</xsl:when>
	    	<xsl:when test="@style[.='italic']">
			<I>
	     		<xsl:value-of select="."/>
			</I>
    		</xsl:when>
	  </xsl:choose>
</xsl:template>

<xsl:template match="person">
		<SPAN STYLE="font-size:14pt;font-style:italic;color:green">
			<xsl:value-of />
		</SPAN>
</xsl:template>

</xsl:template><xsl:template match="p[not(@lede)]">
		<xsl:apply-templates /><br />
		<xsl:value-of />
</xsl:template>


Of course, what happens is that the <em> and <person> tagged text gets
processed correctly, but not inline, instead it repeats, so you get this:

W"trading range," Abby Joseph Cohen "Stock prices will be rising, but at a
less exuberant pace," she says. Wall Street pros call all this backing and
filling a "trading range,"meaning that stocks trade up and down but never
leave a broad range. Abby Joseph Cohen, the Goldman Sachs Group investment
strategist whose optimism has come to symbolize the great bull market of the
1990s, has begun warning clients to expect the market to be more sluggish:
"Stock prices will be rising, but at a less exuberant pace," she says.

I know it's the value-of's which are causing the problem, but can find a way
to do this.  There's probably a simple answer, but it's escaping me.  How do
you do inline markup with XSL ?

thx
gc


 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.