You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by "Vladislav Fuks (JIRA)" <ji...@apache.org> on 2019/02/27 13:03:00 UTC

[jira] [Created] (BATIK-1252) Exception by parsing link from one pattern to the other

Vladislav Fuks created BATIK-1252:
-------------------------------------

             Summary: Exception by parsing link from one pattern to the other
                 Key: BATIK-1252
                 URL: https://issues.apache.org/jira/browse/BATIK-1252
             Project: Batik
          Issue Type: Bug
          Components: Bridge
    Affects Versions: 1.10
            Reporter: Vladislav Fuks
             Fix For: 1.10
         Attachments: Example.svg

There is an exception when parsing local link (_xlink:href_ attribute) from one _<pattern>_ element to the other _<pattern>_ element.

In the attached file "Example.svg" there are two _<pattern>_ elements: "ptrn5-363" and "ptrn5-363_381". The second one refers to the first through it's _xlink:href_ attribute. By parsing second _<pattern>_ element the following exception is thrown:

The URI "#ptrn5-363" specified on the element pattern is invalid (org.apache.batik.bridge.BridgeException) at org.apache.batik.bridge.SVGPatternElementBridge.extractPatternContent(SVGPatternElementBridge.java:259)

In the code position before (SVGPatternElementBridge.java:258) by checking parsed url (_ParsedURL_) there is no check if reference for this parsed url is defined. So if existing check

"_if (!purl.complete())_" will be replaced by: "_if (!purl.complete() && getRef() == null)_" the attached example file will be parsed correctly.

 

P.S. Also with this extended check no exception will be thrown if css contains links to the _<pattern>_ element (_fill:url(#ptrn5-363_381)_) which aren't immediate children of a _<defs>_ element.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org