Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XSL Transformations

Posted on 2011-09-07
4
Medium Priority
?
303 Views
Last Modified: 2012-05-12
I'm using XSL and XML to render DB content.  My first attached snippet is the XSL, the 2nd is the CSS values..

I'm using this to render a chat/discussion. It basically gives me what I want like below:

My Name
Date
Comments......

            Your Name
            Date
            Comments......

My Name
Date
Comments......

            Your Name
            Date
            Comments......


etc..

My question is, how do I make "My Name" and "Your Name" fields render in bold?

Thanks

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
	<xsl:template match="item"> 
		<div class="discussion">
		<div class="{./discussion_class}">
			 <xsl:value-of select="./team_member_name"/><br/><xsl:value-of select="./comment_date"/><br/>
			<xsl:value-of select="./comment"/>
		</div>
		</div>
	</xsl:template> 
</xsl:stylesheet>

Open in new window

.discussion{font-size:12px;font-color:#000000;margin:5px;}
.discussion.my_comment{width:85%;color:#687899;margin:5px;float:left;}
.discussion.others_comment{width:85%;color:#DDDDDD;margin:5px;float:right;}

Open in new window

0
Comment
Question by:PMH4514
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
eridanix earned 2000 total points
ID: 36496200
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
	<xsl:template match="item"> 
		<div class="discussion">
		<div class="{./discussion_class}">
			 <b><xsl:value-of select="./team_member_name"/></b>
                         <br/>
                         <xsl:value-of select="./comment_date"/>
                         <br/>
			<xsl:value-of select="./comment"/>
		</div>
		</div>
	</xsl:template> 
</xsl:stylesheet>

Open in new window

0
 

Author Comment

by:PMH4514
ID: 36496270
ahh, simpler than I expected! I was trying to wrap it with <span> and couldn't get it to work..  then I thought the closing </b> had to instead be <b/>...  Figures I wouldn't try the most obvious. Still pretty new to XSL transformations..

thank you
0
 
LVL 5

Expert Comment

by:eridanix
ID: 36501029
Hi,

this is not about xslt, but about html. In xslt you can use any html tag you want.
0
 

Author Comment

by:PMH4514
ID: 36502220
thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question