xsl-list
[Top] [All Lists]

Re: [xsl] Creating a html <select> dropdown menu in XSL, where the attribute of an XML element is the selected value when page loads

2010-01-04 09:11:16
Hi,
and thank you!
I'm using xsl1. With the help of Davids tip below I made it work.

if using xslt1 the faq has various possibilities

such as

<xsl:for-each select="(//*)[position() &lt;= 10]">
<xsl:variable name="p" select="position()"/>

But new questions arises:

1.This works fine for the days of month, which are never more than 31.
But when I try to build a <select><option> menu with more numbers,
like 50, it only produces a menu with the numbers up to 37. So 37
seems to be some kind of limit. Is there an explanation for this?

2. Another question is that I also want to make a menu for selecting a
month. I want to use the names of the months, not the numbers. How can
I, with XSL, produce something equivalent to an array filled with the
names of the months?

3. And how do I make a menu for years? The "Day of birth" menu starts
from 1 and goes up to 31, but the "Year of birth" menu shouldn't start
from Year 1, but maybe from 1900 and go up to 2010.

4. I understand that "(//*)[position() &lt;= 10]" is an XPath
statement, but I don't understand the syntax. Can anyone explain this
a bit?

5. I guess If I understood XPath at a deeper level I would probably be
able to answer a lot of these questions myself. Can anyone recommend a
place where I can find a good explanation of a little more advanced
XPath syntax than the simple expressions used to navigate between
different levels of nodes?

Regards,
Martin Jackson

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--