speedata / publisher

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

issue with variables in version 4.15.8 #537

Closed pr-apes closed 11 months ago

pr-apes commented 11 months ago

@pgundlach,

if I invoke sp --dummy --no-local -v fname=whatever with the following layout:

<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <PDFOptions duplex="{if (contains($fname, 'sin_folleto')) then 'duplexfliplongedge' else 'duplexflipshortedge'}"/>
  <Record element="data">
    <PlaceObject>
      <Textblock>
        <Paragraph>
          <Value select="."/>
        </Paragraph>
      </Textblock>
    </PlaceObject>
  </Record>
</Layout>

I get the following error:

<Status>
  <Errors>1</Errors>
  <Error code='1'>[page 1] Variable &quot;fname&quot; undefined</Error>
  <DurationSeconds>1</DurationSeconds>
</Status>

I think this might be a bug (probably related to the recent changes in XPath evaluation).

Many thanks for your help.

pgundlach commented 11 months ago

Thank you for your bug report. This is resolved in 628dafa and version 4.15.9.

pr-apes commented 11 months ago

I have exactly the same error with the new release.

Layout:

<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <PDFOptions duplex="{if (contains($fname, 'whatever')) then 'duplexfliplongedge' else 'duplexflipshortedge'}"/>
  <Record element="data">
    <PlaceObject>
      <Textblock>
        <Paragraph>
          <Value select="."/>
        </Paragraph>
      </Textblock>
    </PlaceObject>
  </Record>
</Layout>

Invocation:

sp --dummy --no-local -v fname=whatever

Contents of publisher.status:

<Status>
  <Errors>1</Errors>
  <Error code='1'>[page 1] Variable &quot;fname&quot; undefined</Error>
  <DurationSeconds>1</DurationSeconds>
</Status>

The weird thing is that your are not getting this error, are you?