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

xsl:if / variables / fancy / confusing

Subject: xsl:if / variables / fancy / confusing
From: "Johnathon Wright" <jw@xxxxxxxxxxxxx>
Date: Thu, 17 Nov 2005 15:53:50 -0600
if variables
I'm sure someone will be able to chew through this easily. I can not.

I've got

<configuration>
   ...
   <details>
   ...
       <errors>
           <attribute_285>Please select a Color</attribute_286>
           <attribute_297>Please select a Frame Color</attribute_297>
       </errors>
   </details>
...
</configuration>

and what I want to do is change the style of the drop down with the same name if an error is include in the XSL. This is for form validation. If they don't select a color, etc., it will come back and display that drop-down in some obnoxious color.

Here is the code to generate the select statement:

   <xsl:for-each select="attribute">
    <select name="attribute_{attribute_id}">

<option value="">Select a <xsl:value-of select="attribute_name" /> </option>
<xsl:for-each select="option">
<option value="{option_id}"><xsl:value-of select="option_name"/><xsl:if test="price_offset &gt; 0"> - add <xsl:value-of select="format-number(price_offset, '$###,###,.00')" /></xsl:if></option>
</xsl:for-each>
</select>
</xsl:for-each>


I was thinking:

<select name="attribute_{attribute_id}">
<xsl:if test="/configuration/details/errors/attribute_{attribute_id}"><xsl:attribute name="style">xyz</xsl:attribute></xsl:if>


but it doesn't like that AT ALL.

Just for reference, it will be used on a page like this:

http://www.massageking.com/products/Aphrodite-Wet-Hydraulic/Golden-Ratio-Aphrodite-Wet-Hydraulic/858/2/1

Any ideas?

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.