Replies: 2 comments 2 replies
-
Your <data>
<subsection product='true'>
<element>one</element>
<element>two</element>
<element>three</element>
</subsection>
<subsection specbox='true'>
<element>one</element>
<element>two</element>
<element>three</element>
</subsection>
</data> and <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Record element="data">
<ProcessNode select="*" />
</Record>
<Record element="subsection">
<!-- product is a node -->
<SetVariable variable="product" select="@product" />
<!-- specbox is a node -->
<SetVariable variable="specbox" select="@specbox" />
<ForAll select="*">
<Group name="group">
<Contents>
<Switch>
<Case test="$product = 'true' ">
<PlaceObject>
<Textblock width="10">
<Paragraph>
<Value>a product </Value>
<Value select="." />
</Paragraph>
</Textblock>
</PlaceObject>
</Case>
<Case test="$specbox = 'true' ">
<PlaceObject>
<Textblock width="10">
<Paragraph>
<Value>a spec box </Value>
<Value select="." />
</Paragraph>
</Textblock>
</PlaceObject>
</Case>
</Switch>
</Contents>
</Group>
<!-- CALL THE UNIT BLOCK -->
<PlaceObject groupname="group" />
</ForAll>
</Record>
</Layout> works fine here |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick, I've started working daily on my project, my goal is to have it ready as soon as possible! I fixed a lot of code, actually it contained a lot of pebcak, however when it is time to let the code working with the main switch case the PDF produced is empty. If I remove the main switch case and I run each case as normal code, I mean individually as regular code and not combined, each "case" produces the regular output as expected by the code. I have the feelings the issue is here: <SetVariable variable="case-product" select="@product" />
<SetVariable variable="case-specbox" select="@specbox" /> Although this is based on your recommendations: <!-- product is a node -->
<SetVariable variable="product" select="@product" />
<!-- specbox is a node -->
<SetVariable variable="specbox" select="@specbox" /> So far I haven't understood what I am doing wrong, perhaps this partial log output can tell you what I am doing wrong... <entry level="debug" msg="Call command" name="SetVariable" line="145"></entry>
<entry level="debug" msg="Call command" name="Message" line="148"></entry>
<entry level="message" msg="PROD Variable reads: "></entry>
<entry level="debug" msg="Call command" name="Message" line="149"></entry>
<entry level="message" msg="SPEC Variable reads: "></entry>
<entry level="debug" msg="Call command" name="ForAll" line="155"></entry>
<entry level="debug" msg="Call command" name="Group" line="157"></entry>
<entry level="debug" msg="Create group" name="unit"></entry>
<entry level="info" msg="Grid" rows="800" columns="21"></entry>
<entry level="debug" msg="Call command" name="Switch" line="164"></entry>
<entry level="debug" msg="Call command" name="PlaceObject" line="570"></entry>
<entry level="error" msg="[page 2 line 570] Something is wrong with <PlaceObject>, content is missing"></entry>
<entry level="debug" msg="Call command" name="Group" line="157"></entry>
<entry level="debug" msg="Re-use group" name="unit"></entry>
<entry level="info" msg="Grid" rows="800" columns="21"></entry>
<entry level="debug" msg="Call command" name="Switch" line="164"></entry>
<entry level="debug" msg="Call command" name="PlaceObject" line="570"></entry>
<entry level="error" msg="[page 2 line 570] Something is wrong with <PlaceObject>, content is missing"></entry>
<entry level="debug" msg="Call command" name="Group" line="157"></entry>
<entry level="debug" msg="Re-use group" name="unit"></entry>
<entry level="info" msg="Grid" rows="800" columns="21"></entry>
<entry level="debug" msg="Call command" name="Switch" line="164"></entry>
<entry level="debug" msg="Call command" name="PlaceObject" line="570"></entry>
<entry level="error" msg="[page 2 line 570] Something is wrong with <PlaceObject>, content is missing"></entry> Thanks in advance! 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick,
I am trying to create this switch case in which the first step is to determine which node is currently addressed, useless to say that is not working. This code is based on the first node
<product>
which alone, without the root<Switch>
, works perfectly.I believe this is not the proper way to recall a
<node>
; or worst this is not feasible at all, any suggestion?Thanks in advance... 🙏
C.
Beta Was this translation helpful? Give feedback.
All reactions