lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] help with orphan-control in xsl-fo


From: Greg Chicares
Subject: Re: [lmi] help with orphan-control in xsl-fo
Date: Wed, 20 Jul 2016 14:30:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

[There's actually a new xsltwrapp question at the bottom.]

Way back on 2009-05-17 09:41, Vaclav Slavik wrote:
> On Sat, 2009-05-16 at 21:36 +0200, Vaclav Slavik wrote:
>> I can't even run this, I get errors with fop-0.95 (and it doesn't make
>> to use <0.95 with my patch):
>> 
>>         javax.xml.transform.TransformerException:
>>         org.apache.fop.fo.ValidationException:
>>         file:/tmp/sample.000000001.fo.xml:144:68: Error(144/68):
>>         fo:page-sequence is missing child elements. 
> 
> This error turned out to be because of a bug in reg_d_individual.xsl:
> <xsl:param> elements must be present before anything else in
> <xsl:template>. Please apply this patch to fix it:

Done: commit 2a1ae1a650d0485fff461a03b3fe66c9aa4b1366.

The recently-upgraded libxslt diagnoses this error, which the previous
version had ignored silently. To reproduce (for the historical record
only--it's no longer reproducible with the above change):

$./lmi_wx_shared --ash_nazg --data_path=/opt/lmi/data --pyx=xml

File | New | Illustration
choose a product that uses 'reg_d_individual.xsl'
File | Save as | 'foo.ill'
File | Print to PDF

A messagebox appears:
  runtime error: file C:/opt/lmi/lmi-MID-20160729Z/reg_d_individual.xsl
  line 598 element param
and xslt stops processing the file, causing downstream errors.

To see full diagnostics:

/opt/lmi/bin[0]$xsltproc --noout ../data/reg_d_individual.xsl foo.xml
runtime error: file ../data/reg_d_individual.xsl line 598 element param
Unexpected XSLT element 'param'.
runtime error: file ../data/reg_d_individual.xsl line 599 element param
Unexpected XSLT element 'param'.
runtime error: file ../data/reg_d_individual.xsl line 601 element if
Variable 'displaycontractlanguage' has not been declared.

> This resulted in omission of huge part of the output in the XSLT step,
> hence the error about missing content.

Again, for the historical record only, yesterday we saw another
messagebox that said:

  Exit code 2 from command 'CMD /c /fop-0.20.5/fop -fo
  "c:/fop-0.20.5/unnamed1.fo.xml" -pdf "c:/fop-0.20.5/unnamed1.pdf"'.
...
  [ERROR] Premature end of file.

> I think that older libxslt
> versions (such as the one used on Windows; I'm using 1.1.24) didn't
> catch this error and that's you don't see this particular error
> yourself.

Now, the upgraded libxslt catches it.

> Apparently, libxslt tries to produce at least some output even
> in presence of errors, even though it detects them:
> 
>         $ xsltproc reg_d_individual.xsl /tmp/input_doc.xml  >/dev/null
>         runtime error: file ../reg_d_individual.xsl line 623 element param
>         Unexpected XSLT element 'param'.
>         runtime error: file ../reg_d_individual.xsl line 624 element param
>         Unexpected XSLT element 'param'.
>         runtime error: file ../reg_d_individual.xsl line 626 element if
>         Variable 'displaycontractlanguage' has not been declared.
>         $

Same errors as reported above.

> Worryingly, xsltwrapp didn't throw an exception on this error --
> clearly, this needs to be fixed urgently.

There are arguably two different anomalies here. The first, as Vaclav
noted, is that xsltwrapp didn't throw an exception with the old version
of libxslt. I'm not concerned about that: we do get an exception now
with an updated libxslt. Presumably the old version of libxslt didn't
report this to xsltwrapp as an error (even though xsltproc did diagnose
it as an error).

But I see another anomaly: with current libxslt, xsltwrapp says only:
  runtime error: file C:/opt/lmi/lmi-MID-20160729Z/reg_d_individual.xsl
  line 598 element param
without the extra line
  Unexpected XSLT element 'param'
that we see with xsltproc. That extra line is desirable; is there a way
to have it included in the exception that libxslt throws?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]