-
Hi @pgundlach I'd like to define an accent colors but it should be defined inside the parent node: <section secname="SEC01" accent="MyColors">
<subsection subsecname="SubSec01">
<product title="00">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
[...]
<product title="20">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
</subsection>
[...]
</section> However since the code I am running uses this syntax: <Record element="subsection">
<SetVariable variable="subsecname" select="@subsecname" />
<SetVariable variable="accent" select="@accent" />
[...]
<ForAll select="product">
[...]
<ForAll select="extra">
<PlaceObject column="1">
<Frame backgroundcolor="{$accent}">
</PlaceObject>
</ForAll>
[...]
</ForAll>
</Recod> The "accent" value is not taken, but if I move it in the subsection node, the value is taken properly: <section secname="SEC01" xmlns:xi="http://www.w3.org/2001/XInclude">
<img file="SectionIMG.jpg" />
<subsection subsecname="SubSec01" accent="MyColors">
<product title="00">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
[...]
<product title="20">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
</subsection>
<subsection subsecname="SubSec02" accent="MyColors">
<product title="00">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
[...]
<product title="20">
<item>DUMMY</item>
<item>DUMMY</item>
<item>DUMMY</item>
<extra>DUMMY DUMMY DUMMY</extra>
<extra>DUMMY DUMMY DUMMY DUMMY </extra>
<extra>DUMMY DUMMY DUMMY DUMMY DUMMY</extra>
<img file="sample.pdf"/>
</product>
</subsection>
[...]
</section> Unfortunately there isn't any advantage to assign the accent attribute to each subsection, unless I can define somewhere in this document a variable Is that possible in the data xml assign a variable only for sake to avoid typing it every time? Thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You have two options:
or
<Record element="subsection">
<SetVariable variable="accent" select="../@accent" />
... ( add |
Beta Was this translation helpful? Give feedback.
Solution 2 will work with the next version of the speedata Publisher (not yet available)
Solution 1 will be
<SetVariable variable="accent" select="@accent" />
in<Record element="section">