Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT for-each get previous item [Thread Next] Re: XSLT for-each get previous itemTo: NULL Date: 2/7/2009 5:49:00 PM DustWolf wrote:
> On 6 feb., 12:33, Martin Honnen <mahotr...@yahoo.de> wrote:
>> DustWolf wrote:
>>> I have been trying to do this with the position() function and have
>>> come up with this:
>>> <xsl:for-each select="/values/value">
>>> <item last="{/values/value[position()-1]}" current="{.}" />
>> <item last="{preceding-sibling::value[1]}"
>
> This does not work for me (I'm getting blanks). My nodes are actually
> in another namespace, could this be the problem (e.g.: "data:value",
> not "value")? Where do I add the namespace?
If you really have
<xsl:for-each select="/values/value">
then I see no reason why
preceding-sibling::value[1]
would not work. If you have e.g.
<xsl:for-each select="/data:values/data:value">
(where the prefix 'data' is bound to a namespace) then you need
preceding-sibling::data:value[1]
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
