-
Hello @pgundlach Today I hope to solve this by myself but I failed... π This time I articulated
<data>
<category head="SPECIES">
<animals title="MAMMALS">
<item>Baby Dog</item>
<item>Baby Cat</item>
<item>Baby Horse</item>
<item>Mommy Dog</item>
<item>Mommy Cat</item>
<item>Mommy Horse</item>
<item>Daddy Dog</item>
<item>Daddy Cat</item>
<item>Daddy Horse</item>
</animals>
<animals title="BIRDS" new="true">
<item>Baby Eagle</item>
<item>Baby Flamenco</item>
<item>Baby Vultur</item>
<item>Mommy Eagle</item>
<item>Mommy Flamenco</item>
<item>Mommy Vultur</item>
<item>Daddy Eagle</item>
<item>Daddy Flamenco</item>
<item>Daddy Vultur</item>
</animals>
<animals title="FISHES">
<item>Baby Shark</item>
<item>Baby Betta</item>
<item>Baby Tuna</item>
<item>Mommy Shark</item>
<item>Mommy Betta</item>
<item>Mommy Tuna</item>
<item>Daddy Shark</item>
<item>Daddy Betta</item>
<item>Daddy Tuna</item>
</animals>
<animals title="REPTILES" new="true">
<item>Baby Lizard</item>
<item>Baby Turtle</item>
<item>Baby Crocodile</item>
<item>Mommy Lizard</item>
<item>Mommy Turtle</item>
<item>Mommy Crocodile</item>
<item>Daddy Lizard</item>
<item>Daddy Turtle</item>
<item>Daddy Crocodile</item>
</animals>
<animals title="AMPHIBIANS">
<item>Baby Frog</item>
<item>Baby Toad</item>
<item>Baby Salamander</item>
<item>Mommy Frog</item>
<item>Mommy Toad</item>
<item>Mommy Salamander</item>
<item>Daddy Frog</item>
<item>Daddy Toad</item>
<item>Daddy Salamander</item>
</animals>
<animals title="INSECTS" new="true">
<item>Baby Ladybug</item>
<item>Baby Spider</item>
<item>Baby Dragonfly</item>
<item>Mommy Ladybug</item>
<item>Mommy Spider</item>
<item>Mommy Dragonfly</item>
<item>Daddy Ladybug</item>
<item>Daddy Spider</item>
<item>Daddy Dragonfly</item>
</animals>
</category>
</data> Then I tried to create headers and footers with areas but I didn't work out cause those requires unit grids, then I simply put this <!-- HEADER -->
<PlaceObject allocate="no" column="12.5mm" row="16mm" frame="solid" framecolor="green" >
<Table width="185mm" height="2cm" fontfamily="tito" stretch="max">
<Tr align="center">
<Td>
<Paragraph>
<Value>HEADER</Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
<!-- FOOTER -->
<PlaceObject allocate="no" column="12.5mm" row="260mm" frame="solid" framecolor="green" >
<Table width="185mm" height="2cm" fontfamily="tito" stretch="max">
<Tr align="center">
<Td>
<Paragraph>
<Value>FOOTER</Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject> Then I tried to display the value <Record element="data">
<ProcessNode select="*" />
</Record> However it didn't work out as well, eventually I was really creative using all the combinations but the right ones. This last version with the header and footer between Here <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en" >
<!-- PAGE SIZE & BASIC GRID -->
<SetGrid nx="3" ny="2" />
<Trace grid="yes" textformat="yes" objects="no" />
<Pageformat width="210mm" height="282mm" />
<!-- FONTS DEFINITIONS -->
<LoadFontfile name="CrimsonPro-Regular" filename="CrimsonPro-Regular.ttf" mode="harfbuzz"/>
<LoadFontfile name="CrimsonPro-Bold" filename="CrimsonPro-Bold.ttf" mode="harfbuzz"/>
<LoadFontfile name="CamingoCode-Bold" filename="CamingoCode-Bold.ttf" mode="harfbuzz" />
<LoadFontfile name="CamingoCode-Italic" filename="CamingoCode-Italic.ttf" mode="harfbuzz" />
<DefineFontfamily fontsize="12" leading="14" name="para">
<Regular fontface="CrimsonPro-Regular" />
</DefineFontfamily>
<DefineFontfamily fontsize="16" leading="20" name="tito">
<Regular fontface="CamingoCode-Regular" />
<Bold fontface="CamingoCode-Bold" />
<Italic fontface="CamingoCode-Italic" />
</DefineFontfamily>
<!-- PAGE LAYOUT -->
<Pagetype name="page" test="true()">
<Margin left="12.5mm" right="12.5mm" top="25mm" bottom="25mm" />
<!-- HEADER -->
<AtPageCreation>
<PlaceObject allocate="no" column="12.5mm" row="16mm" frame="solid" framecolor="green" >
<Table width="185mm" height="2cm" fontfamily="tito" stretch="max">
<Tr align="center">
<Td>
<Paragraph>
<Value select="@head" />
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageCreation>
<!-- FOOTER -->
<AtPageShipout>
<PlaceObject allocate="no" column="12.5mm" row="260mm" frame="solid" framecolor="green" >
<Table width="185mm" height="2cm" fontfamily="tito" stretch="max">
<Tr align="center">
<Td>
<Paragraph>
<Value>FOOTER</Value>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageShipout>
</Pagetype>
<!-- ############## -->
<!-- BEGINS CONTENT -->
<!-- ############## -->
<!-- Loads all nodes -->
<Record element="data">
<ProcessNode select="category" />
</Record>
<Record element="category">
<!-- UNIT BLOCK -->
<Group name="unit">
<Grid width="1cm" height="12pt" />
<Contents>
<!-- TITLE BLOCK -->
<PlaceObject>
<Table padding="2mm" width="6" stretch="max" fontfamily="tito">
<Columns>
<Column width="3*" />
<!-- ADD "NEW" COLUMN -->
<Switch>
<Case test="@new = 'true'">
<Column width="1*" />
</Case>
</Switch>
<!-- END "NEW" COLUMN -->
</Columns>
<Tr backgroundcolor="yellow">
<Td>
<Paragraph>
<B><Value select="@title" /></B>
</Paragraph>
</Td>
<!-- IT IS NEW -->
<Switch>
<Case test="@new = 'true'">
<Td align="center" backgroundcolor="red">
<Paragraph>
<I><Value>NEW</Value></I>
</Paragraph>
</Td>
</Case>
</Switch>
<!-- END NEW -->
</Tr>
</Table>
</PlaceObject>
<!-- JUMP A COUPLE OF LINES -->
<NextRow rows="2" />
<!-- BULLET POINTS -->
<PlaceObject>
<Textblock width="6" fontfamily="para">
<Ul>
<ForAll select="item">
<Li><Value select="." /></Li>
</ForAll>
</Ul>
</Textblock>
</PlaceObject>
</Contents>
</Group>
<!-- CALL THE UNIT BLOCK -->
<PlaceObject groupname="unit" />
</Record>
</Layout> Perhaps eventually I will be able to understand better how it works... Thanks in advance for helping me with this! π |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Just a first small part of the answer, I don't know how much time I have now ;-)
There is a problem here, you cannot access attributes ( So you have to define a variable and use it in the head: <Record element="category">
<SetVariable variable="head" select="@head"/> and <Pagetype name="page" test="true()">
<Margin left="12.5mm" right="12.5mm" top="25mm" bottom="25mm" />
<!-- HEADER -->
<AtPageCreation>
<PlaceObject allocate="no" column="12.5mm" row="16mm" frame="solid" framecolor="green">
<Table width="185mm" fontfamily="tito" stretch="max">
<Tr align="center">
<Td>
<Paragraph>
<Value select="$head" />
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageCreation> (you see the More later.... |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, perhaps I overthought, I am going to focus on replicate a real section of our catalog. I am too much behind my schedule, and next Monday I have the first meeting about our biggest catalog and nothing to show up about speedata... π€¦ββοΈ |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Just a first small part of the answer, I don't know how much time I have now ;-)
There is a problem here, you cannot access attributes (
@head
) in the page definition, since there is no "current node" when the page is created (the cursor in the data can be anywhere and@head
does not know where it should look for the attribute).So you have to define a variable and use it in the head:
and