speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
300 stars 36 forks source link

Lazy evaluation of Grid in Pagetype #130

Closed pgundlach closed 7 years ago

pgundlach commented 7 years ago

It should be possible to write something like this:

<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">
  <Pageformat width="80mm" height="50mm" />
  <Trace grid="yes"/>

  <Pagetype name="a" test="true()">
    <Margin left="1cm" right="1cm" top="1cm" bottom="1cm" />
    <Grid height="{$ht}" nx="10"/>
  </Pagetype>

  <Record element="data">
    <SetVariable variable="ht" select="'12pt'"/>
    <PlaceObject>
      <Textblock>
        <Paragraph>
          <Value>text</Value>
        </Paragraph>
      </Textblock>
    </PlaceObject>
    <SetVariable variable="ht" select="'1cm'"/>
    <NewPage/>
    <PlaceObject>
      <Textblock>
        <Paragraph>
          <Value>text</Value>
        </Paragraph>
      </Textblock>
    </PlaceObject>
  </Record>
</Layout>

To get lazy evaluation in a page type.

pgundlach commented 7 years ago

Implemented in b3a41ef17aa499c06f8d3f98161518615500f6c2