[xep-support] Re: Fwd: Why is this test document failing?

Anderson, Paul Paul.Anderson at compuware.com
Fri Apr 19 05:43:51 PDT 2013


Greetings,

We've had this problem for a while now with our SVG graphics created in Inkscape and rendered in XEP. The problem is that linearGradient elements can reference other linearGradient elements and XEP is sensitive to the order in which they occur in the document tree. 

For example, if you have a rectangle with filled with a linearGradient and you copy and paste that rectangle in Inkscape, the pasted rectangle will contain a new linearGradient with a unique ID, but it references the ID of the linearGradient in the copied rectangle for its content. Inkscape happens to write these elements with the referencing linearGradient first and the referenced linearGradient second. XEP is sensitive to this condition and throws the errors you report in your message. In the SVG specification, there is no mention of a requirement that the referenced linearGradients must be defined (that is, occur in the document tree) before those linearGradient elements that reference them. 

When the warning occurs, the result is that the drawing does not output correctly. If, however, you manually reorder the linearGradient elements in the SVG file such that the referenced linearGradient elements come first, XEP does not throw a warning and renders the graphic correctly.

In the attached archive, I've provided the following:

- An SVG drawing where two rectangles were manually adjusted in Inkscape to use the same linearGradient. The order of the elements is not an issue in this file and the output is correct.

- An SVG drawing with a copied rectangle containing a linearGradient element. Inkscape writes the element in an order that XEP doesn't like and the output of the second rectangle is wrong. The warning from XEP is:
[warning] No 'linearGradient' element found with id="linearGradient2987-7"; referenced linear gradient ignored.

- An SVG drawing identical to the previous one except the order of the referenced/referencing linearGradient elements was adjusted such that the referenced element comes first. Now the order is not an issue and the output is correct.

- The XSL-FO document that we passed to XEP

- The resulting PDF, demonstrating the output issues with referenced linearGradient elements.

I must confess that I've been meaning to report this issue for a long time. Reinier, thank you for starting this thread and boosting my motivation.

Note that this demonstration was performed with XEP 4.21 build 20121114.

Best regards,

Paul Anderson
Information Developer - Codex Administrator
Compuware Corporation - +1-313-227-2031


-----Original Message-----
From: xep-support-bounces at renderx.com [mailto:xep-support-bounces at renderx.com] On Behalf Of Reinier Kleipool
Sent: Friday, April 19, 2013 3:52 AM
To: xep-support at renderx.com
Subject: [xep-support] Fwd: Why is this test document failing?

Hello,

  Why are there problems with LineairGradients in this test document? 
Apache Batik displays it correct an so does Inkscape that was used to produce it...
Reinier

      [warning] No 'linearGradient' element found with id="linearGradient4024-2"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4024-9"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4024"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3896-9"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3896"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3720-6"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3720-9"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3720-4"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3720"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4396-0"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4396-4"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4396-5"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4396"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3896-9-1"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient3896-9-26"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4024-4-8"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4024-4-0"; referenced linear gradient ignored.
      [warning] No 'linearGradient' element found with id="linearGradient4024-4"; referenced linear gradient ignored




!DSPAM:87,5170f7c39852052032467!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gradientBugDemo.zip
Type: application/x-zip-compressed
Size: 243623 bytes
Desc: gradientBugDemo.zip
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20130419/a4b99c3a/attachment-0001.bin>


More information about the Xep-support mailing list