NPE / How can i locate an error in CSS Stylesheets?

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

NPE / How can i locate an error in CSS Stylesheets?

Post by fsteimke »

Dear Oxygen staff,

i am using PDF Chemistry as part of the Oxygen XML Editor (Professional Edition).
Version is XML Editor 26.0, build 2024012406. Environment is Windows 10.
I try to convert an HTML File to PDF and get a Null Pointer Exception . Maybe it is caused by this warning:

Code: Select all

Cannot evaluate functions from: 'var(--margin-above)', got: Cannot invoke "ro.sync.ecss.css.functions.kb.l(String)" because the return value of "ro.sync.ecss.css.functions.ab.c()" is null
I am using the xslTNG Stylesheets to convert DocBook to HTML, and the CSS Stylesheets that are part of xslTNG together with some local modifications. You can find the HTML file and the CSS Stylesheets in the attached archive
err.zip
(334.7 KiB) Downloaded 15 times
I have boiled it down to a minimum size, thats why there are unresolved internal references.

If there are any errors in the CSS stylesheets, i will of course correct hem. But a hint about the CSS rule which causes the error would be very helpfull (maybe file name and line number)?
Thanks in advance,
Frank Steimke
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: NPE / How can i locate an error in CSS Stylesheets?

Post by julien_lacour »

Hello Frank,

The problem is that you declare the CSS variables (like --margin-above) under the :root pseudo-class but use them under the @page rules.
The :root class is at document level where @page is "above" it: if you use the variables in @page you should declare them in @page too.

Regards,
Julien
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

Re: NPE / How can i locate an error in CSS Stylesheets?

Post by fsteimke »

Hi Julien,

thanks for the quick response. I will check and correct the CSS Stylesheets.

However, errors like this should not lead to an Nullpointer Exception, but to an error message.

Thanks again, Frank
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: NPE / How can i locate an error in CSS Stylesheets?

Post by julien_lacour »

Hi Frank,

I also added an issue to change the exception into an error message, I will notify this thread when it will be fixed.

Regards,
Julien
Post Reply