Szabo, Patrick (LNG-VIE) wrote:
> I have an issue with the following line:
>
>
>
> <cfg:set variable="curr_path"
> expression="R:\Produktion\Print\ARD-Handbuch\*xxxx*\xml"
> plainString="true"/>
>
>
>
> The thing is:
>
>
>
> I would like to automatically replace ?*xxxx*? with the current year. Is
> there a way to provide that?!
>
>
>
<cfg:set variable="curr_path"
expression="concat('R:\Produktion\Print\ARD-Handbuch\',XXXX,'\xml')" />
where XXXX is a XPath expression that returns current year. Note that
you need to remove plainString="true".
Example:
<cfg:set variable="curr_path"
expression="concat('R:\Produktion\Print\ARD-Handbuch\',(1900+date:getYear(date:new())),'\xml')"
xmlns:date="java:java.util.Date" />
I've tested the above solution using the following macro:
---
<command name="currentYear" xmlns:date="java:java.util.Date">
<macro >
<sequence>
<get
expression="concat('R:\Produktion\Print\ARD-Handbuch\',(1900+date:getYear(date:new())),'\xml')"/>
<command name="alert" parameter="%_" />
</sequence>
</macro>
</command>
<binding>
<keyPressed code="F3" />
<command name="currentYear" />
</binding>
---