speedata / publisher

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

weird error because of comment #396

Closed pr-apes closed 2 years ago

pr-apes commented 2 years ago

I have this sample:

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

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

<Trace gridallocation="yes"/>
  <Record element="data">
    <PlaceObject>
    <Image width="{$_pageheight * 2}" file="_samplea.pdf"/>
  </PlaceObject>
  </Record>
</Layout>

Running it with sp --dummy --autoopen, I get this error message:

Loading layout instructions "d:\\spublisher\\layout.xml"
Error: [page 1] Without a valid layout-XML file, I can't really do anything.
Stop processing data
1 errors occurred
Duration: 0.023000 seconds
Total run time: 947.0541ms

As far as I know, the XML above is a valid XML comment.

Am I missing something or is this a bug?

Many thanks for your help.

pr-apes commented 2 years ago

I also wanted to ask, how can I get division instead of multiplication in <Image width="{$_pageheight * 2}" file="_samplea.pdf"/>?

Many thanks for your help.

pgundlach commented 2 years ago

Your file is valid XML and should be parsed correctly, so this is an error in the software.

For the division: use div (see https://www.w3schools.com/xml/xpath_operators.asp)

pr-apes commented 2 years ago

Many thanks for the fix and the info about XPath operators.