Advertisement

09.03.2008 at 02:39AM PDT, ID: 23698588 | Points: 500
[x]
Attachment Details

Using XSL to work out number differences

Asked by moore82 in Extensible Stylesheet Language Transformation (XSLT), Extensible Markup Language (XML), XPath

Tags:

Hi

I have a page that receives some XML with minimum and maximum values for dropdown menus. For example...

Max Price: £54,995.00
Min Price: £2,459.62

I need the XSL to work out the other drop down options (the intervals). So the XSL should loop and write out different values. So for the above example I would like the intervals to be...

<option value="2000">2000</option>
<option value="3000">3000</option>
<option value="4000">4000</option>
<option value="5000">5000</option>
<option value="6000">6000</option>
<option value="7000">7000</option>
<option value="8000">8000</option>
<option value="9000">9000</option>
<option value="10000">10000</option>
<option value="11000">11000</option>
<option value="12000">12000</option>
<option value="13000">13000</option>
<option value="14000">14000</option>
<option value="15000">15000</option>
<option value="16000">16000</option>
<option value="17000">17000</option>
<option value="18000">18000</option>
<option value="19000">19000</option>
<option value="20000">20000</option>
<option value="22500">22500</option>
<option value="25000">25000</option>
<option value="27500">27500</option>
<option value="30000">30000</option>
<option value="32500">32500</option>
<option value="35000">35000</option>
<option value="37500">37500</option>
<option value="40000">40000</option>
<option value="45000">45000</option>
<option value="50000">50000</option>
<option value="55000">55000</option>

It's quite a clever script as it needs to figure the min value and go one step down and write from there until the max value is covered.

I hope this explains it well enough!Start Free Trial
[+][-]09.03.2008 at 07:51AM PDT, ID: 22377889

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 01:13AM PDT, ID: 22415361

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 08:03AM PDT, ID: 22418072

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628