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

RE: Newbie: Embedding styles in XML blocks

Subject: RE: Newbie: Embedding styles in XML blocks
From: Ryan Graham <Ryan.Graham@xxxxxxxxxxxxx>
Date: Wed, 24 Sep 2003 09:59:13 -0700
ryan styles
Try

<xsl:template match="para">
	<p><xsl:apply-templates /></p>
</xsl:template>

<xsl:template match="i">
	<i><xsl:value-of select="." /></i>
</xsl:template>

This will provide the following HTML output:

<p>This is an <i>important</i> paragraph</p>

The built in XSL template rules will grab the text before the <i> node, then
apply-templates will process the  
<i> node. Once it is finished, it returns to the <para> node and grabs the
rest of the text.

Hope this helps...

-RG

-----Original Message-----
From: Arne Claassen [mailto:xsl@xxxxxxxxxxxx] 
Sent: Wednesday, September 24, 2003 9:23 AM
To: xsl list
Subject:  Newbie: Embedding styles in XML blocks


I'm relatively new to XSL, trying to ween myself of customer HTML
templating solutions. There's a fairly simple issue i've run into a
couple of times, which is embedding simple style controls in a paragraph
of XML data, such as:

<para>This is an <i>important</i> paragraph</para>

These are the ways i've tried to render it
                                                       
<xsl:template match="para">
  <p><xsl:value-of select="."/></p>
</xsl:template>
..which strips out the <i>.

<xsl:template match="para">
  <p><xsl:value-of select="*"/></p>
</xsl:template>
..which displays only the contents of <i>

<xsl:template match="para">
  <p><xsl:value-of select="*"/></p>
</xsl:template>
..which displays everything inclusing the enclosing <para>
                   
I know, i know, i now have HTML in my XML, so of course i'm open to a
solution that does text styling in the proper XSL fashion (which i don't
know right).

I just don't want to resort to using <![CDATA[ ]]> for all my text
chunks that have styling embedded

thanks,
arne


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

 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.