Huditsch Roman wrote:
> Ah, I see.
> Actually, i think that macro variables would be enough, if I would be able to
> save them.
> Here is my code so far:
>
> <cfg:command name="get-stichworte">
> <cfg:macro>
> <cfg:sequence>
> <cfg:command name="pick" parameter="Herausgeber
> true Fuchs fuchs G.Weilinger g.weilinger Lanner lanner LexisNexis LexisNexis
> Mohr mohr Stumvoll stumvoll Weilinger weilinger"/>
> <cfg:set variable="autor" expression="%_"
> plainString="true"/>
> <cfg:get expression="$autor"/>
> <cfg:command name="read-stichworte"
> parameter="%_"/>
> <cfg:command name="pick" parameter="Stichworte
> false %_"/>
> <cfg:set variable="stichwort" expression="%_"
> plainString="true"/>
> <cfg:command name="insertNode"
> parameter="sameElementAfter[implicitElement]"/>
> <cfg:get expression="$autor"/>
> <cfg:command name="putAttribute"
> parameter="herausgeber %_"/>
> <cfg:choice>
> <!--IF-->
> <cfg:sequence>
> <!--TEST-->
> <cfg:test
> expression="$autor!='LexisNexis'"/>
> <!--THEN-->
> <cfg:command name="pick"
> parameter="Kodex false AVG BR HR StrR VfR WohnG ZGV"/>
> <cfg:command
> name="putAttribute" parameter="kodex %_"/>
> <cfg:get
> expression="$stichwort"/>
> <cfg:command
> name="putAttribute" parameter="idref_stichwort %_"/>
> <cfg:get expression="$autor"/>
> <cfg:command name="clean"
> parameter="%-"/>
> </cfg:sequence>
> <cfg:sequence>
> <!--ELSE-->
> <cfg:get
> expression="$stichwort"/>
> <cfg:command
> name="putAttribute" parameter="idref_stichwort %_"/>
> <cfg:get expression="$autor"/>
> <cfg:command name="clean"
> parameter="%_"/>
> </cfg:sequence>
> </cfg:choice>
> </cfg:sequence>
> </cfg:macro>
> </cfg:command>
> <cfg:command name="read-stichworte">
> <cfg:process showProgress="false">
> <cfg:transform
> stylesheet="stylesheets/get_keywords.xslt"
> file="G:/Gesetzestextredaktion/daten/Stichworte/%0.xml"
> to="G:/Gesetzestextredaktion/daten/Stichworte/%0_out.xml"
> cacheStylesheet="true"/>
> <cfg:read
> file="G:/Gesetzestextredaktion/daten/Stichworte/%0_out.xml" encoding="UTF-8"/>
> </cfg:process>
> </cfg:command>
>
>
> How could I use the <cfg:set> command to store macro variables?
You have already done that in
---
<cfg:set variable="autor" expression="%_" plainString="true"/>
---
("%_" is a macro-variable like "%0", "%1", etc).
Given the fact that you need to reference variable "autor" in several
places of your macro, you really need to write something like:
---
<cfg:set variable="autor" expression="%_" plainString="true"/>
<cfg:get expression="$autor"/>
.
.
.
<cfg:get expression="$autor"/>
.
.
.
<cfg:get expression="$autor"/>
.
.
.
<cfg:get expression="$autor"/>
---
There is no simpler way to do that.