Solved

XSL Transformations

Posted on 2011-09-07
4
299 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

733 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