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

RE: doubt

Subject: RE: doubt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 7 Apr 2005 09:06:47 +0100
RE:  doubt
>    I am having the xml file in this format.
> 
> <question  correctid="3" Qno="370" >
>    <stmt1 mgif1="" mgif="" misc="" >Kepler's first law of 
> planetary motion  is also called </stmt1>
>    <stmt2 mgif1="" mgif="" misc="" />
>    <opt mgif1="" mgif="" voiceover="" >law of periods</opt>
>    <opt mgif1="" mgif="" voiceover="" >law of areas</opt>
>    <opt mgif1="" mgif="" voiceover="" >law of orbits</opt>
>    <opt mgif1="" mgif="" voiceover="" >law of distances</opt>
>   </question>
> 
> 
> For example, If the correct id number value is 3 the law of 
> orbits value 
> should appear in different color. so according the correct id 
> the color of 
> the option should get changed. Is it possible to do ?
> 

Not a very useful subject line.

Yes, use logic like the following, with opt as the context node:

<xsl:if test="../@correctId = count(preceding-sibling::opt)+1">
  <xsl:attribute name="colour">pink</xsl:attribute>
</xsl:if>

Michael Kay
http://www.saxonica.com/

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.