Hi Selva,
thats because you didn't use the xlink namespace but "null", which
defaults to the SVG namespace and is wrong.
Try using the following:
cursor.setAttributeNS("http://www.w3.org/1999/xlink","href","zoomin.png");
Also note that gif might not be supported in all viewers, but png will
be supported. Also I would recommend to use a relative URI and not an
absolute. Otherwise you can't move your project to different machines.
Andreas
Element cursor = doc.createElementNS(svgNS, "cursor");
cursor.setAttributeNS(null, "id", "zoomin");
cursor.setAttributeNS(null, "xlink:href", "file:///E:/zoomin.gif");
defs.appendChild(cursor);
doc.getRootElement().appendChild(defs);
doc.getRootElement().setAttributeNS(null, "style", "cursor:url
(#zoomin),crosshair");
org.apache.batik.bridge.BridgeException: null:0
The attribute "xlink:href" of the element <cursor> is required
at org.apache.batik.bridge.CursorManager.convertSVGCursorElement
(CursorManager.java:333)
at org.apache.batik.bridge.CursorManager.convertSVGCursor
(CursorManager.java:303)
at org.apache.batik.bridge.CursorManager.convertCursor(CursorManager.java:198)
at org.apache.batik.bridge.CSSUtilities.convertCursor(CSSUtilities.java:254)
at org.apache.batik.bridge.BridgeContext$DOMMouseOverEventListener.handleEvent
(BridgeContext.java:1485)
at org.apache.batik.dom.events.EventSupport.fireEventListeners
(EventSupport.java:350)
at org.apache.batik.dom.events.EventSupport.fireEventListeners
(EventSupport.java:407)
at org.apache.batik.dom.events.EventSupport.dispatchEvent
(EventSupport.java:281)
at org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:1010)
.
.
.
Thanks,
Selva
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093 Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: [EMAIL PROTECTED]
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]