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

Dealing with undefined variables #521

Closed serpent213 closed 9 months ago

serpent213 commented 9 months ago

Is there a proper way to deal with variables (in layout.xml) that may or may not be defined?

I tried various approaches:

Current workaround is to just expect the variable to be set, if unused to an empty string. Otherwise sp will throw errors during the run, but the output will still be correct. So in the end this is more of a cosmetical issue.

pgundlach commented 9 months ago

There is sd:variable-exists(<name>). See https://doc.speedata.de/publisher/en/xpathfunctions/.

Does this help?

serpent213 commented 9 months ago

Oh, of course, that one somehow slipped through. 🙂

Thank you!