Wrox Programmer Forums
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2010, 06:43 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Smile Compare

Hi All,


Problem 1:

I have to convert xml to html. i converted html document. but i want to check attribute value

<decision.unit module.type="20"

The attribute value 20(module.type="20" id default value). If come the attribute value 21 that time show error message in html.

How to code this in xsl. Kindly help.


Problem 2:

I have xml entity value for &#x2013; and 2014;. these value for opening and closing quote. i want those two value in diffent color. How to find that value in XSL. Kindly help.

 
Old November 24th, 2010, 07:54 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Posting two problems in one thread is a really bad idea. I will ignore your second question, please raise it again in a new thread.

On problem 1, the best way to do conditional logic in XSLT is usually with template rules. You want a rule something like this:

Code:
<xsl:template match="decision.unit[@module.type='21']">
  <p class="error-message">Module type must not be 21</p>
</xsl:template>
Here class=error-message is supposed to be a reference to a CSS rule for styling error messages in your HTML.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 25th, 2010, 12:43 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

In XML persent hexadecimal value for Quote. The viewer want difference of color for quote (ie opening and closing quote. The entity value for opening and closing quote hexadecimal values are &#x2013 and 2014). how to apply in xsl. Kindly give a solution





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare the value elayaraja.s XSLT 3 July 28th, 2008 07:48 AM
compare Neha XSLT 6 July 24th, 2008 08:11 AM
compare nmnm XSLT 3 April 24th, 2007 08:13 AM
Problems with doing compare Samazf Excel VBA 1 September 27th, 2006 02:04 PM
compare these date fields and compare and get the susanring Oracle 1 July 24th, 2006 04:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.