Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with variables in version 4.15.8 #537

Closed
pr-apes opened this issue Nov 6, 2023 · 2 comments
Closed

issue with variables in version 4.15.8 #537

pr-apes opened this issue Nov 6, 2023 · 2 comments

Comments

@pr-apes
Copy link
Contributor

pr-apes commented Nov 6, 2023

@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 added a commit that referenced this issue Nov 7, 2023
* Simple for expression
* Bugfix (#537)
@pgundlach
Copy link
Member

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

@pr-apes
Copy link
Contributor Author

pr-apes commented Nov 8, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants