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

Exception by parsing link from one pattern to the other

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10
    • 1.10
    • Bridge
    • None
    • 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. BATIK-1252_fix.patch
          0.8 kB
          alts
        2. Example.svg
          2 kB
          Vladislav Fuks

        Activity

          People

            Unassigned Unassigned
            vladislav.f Vladislav Fuks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: