Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1252

Exception by parsing link from one pattern to the other

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.10
    • Fix Version/s: 1.10
    • Component/s: Bridge
    • Labels:
      None
    • Flags:
      Important

      Description

      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.

        Attachments

        1. Example.svg
          2 kB
          Vladislav Fuks
        2. BATIK-1252_fix.patch
          0.8 kB
          Alexey Tsarev

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vladislav.f Vladislav Fuks
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: