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.