speedata / publisher

speedata Publisher - a professional database Publishing system

Home Page:https://www.speedata.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`%USERPROFILE%` not working in layout

pr-apes opened this issue · comments

@pgundlach,

I have the following layout:

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

  <Record element="data">
    <PlaceObject>
      <Image file="{$pdfdoc}"/>
    </PlaceObject>
    <ClearPage/>
    <PlaceObject>
      <Image file="%USERPROFILE%\Desktop\a.pdf"/>
    </PlaceObject>
  </Record>

</Layout>

Invoking it with sp --dummy -v pdfdoc=%USERPROFILE%\Desktop\a.pdf, the first image is resolved and the second one is not.

Is there no way to get Windows variables working when included in layout?

This is a minimal example, but my usage is reading from data.xml (which has been converted from a CSV file).

BTW, I cannot check it, but I wonder whether this would be the same as ~/ and $HOME/ in Unix.

Many thanks for your help.

There is no interpretation of %VARIABLES% or $VAR or ~/ or so from within speedata.

You might be able to configure pathrewrite in the configuration file (https://doc.speedata.de/publisher/en/configuration/). Perhaps this works:

pathrewrite=%USERPROFILE%=C:\Users\myname\wherever

in the publisher.cfg.

This wouldn't help in my case, because each user should do the same (and this might be too complex for some of them).