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 bu...@apache.org on 2006/11/08 20:41:03 UTC

DO NOT REPLY [Bug 40927] New: - DOMUtilities#deepCloneDocument(Document, DOMImplementation) returns corrupted document

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40927

           Summary: DOMUtilities#deepCloneDocument(Document,
                    DOMImplementation)  returns corrupted document
           Product: Batik
           Version: 2.0
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bridge
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: aboyko@ca.ibm.com


A GMF client application is capable of substituting fill and stop colors if they
are white or black with user customized colors. Color substitution is done
manually by iterating through document node elements. Before the color switching
is done the original SVGOMDocument is cloned using
DOMUtilities.deepCloneDocument() method as following:

DOMImplementation impl;
impl = SVGDOMImplementation.getDOMImplementation();
document = DOMUtilities.deepCloneDocument(document, impl);

The end document is one used by GVTBuilder.build() which throws the following
BridgeException with the code = "uri.malformed". Therefore, the image is not
rendered. This is without color switching - the cloned document is untouched.
Full stack trace is listed at the bottom.

If the document is not cloned, no exceptions thrown and the image is rendered. 

The exception occurs for image: "SVG_gradient_noattr.svg"
but doesn't occur for image: "SVG_flat.svg"
(Both images will be attached)

Since, I would expect cloned and the original documents to be handled in the
same way by GVTBuilder#build(BridgeContext, SVGOMDocument), perhaps there is a
bug somewhere in DOMUtilities.deepCloneDocument()?

Would be nice to know what's special about image "SVG_gradient_noattr.svg"
compared to "SVG_flat.svg"? Why the first one gives an exception and the second
doesn't?

Note: http://issues.apache.org/bugzilla/show_bug.cgi?id=40862 might be related
to this one.


Stack Trace:

org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
null:-1
The URI "#linearGradient7288"
specified on the element <linearGradient> is invalid

	at
org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.ImageTranscoderEx.transcode(ImageTranscoderEx.java)

	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)

	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)

	at
org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImageConverter.setUpTranscoders(SVGImageConverter.java:148)

	at
org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImageConverter.renderSVGtoSWTImage(SVGImageConverter.java:74)

	at
org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImage.renderImage(SVGImage.java:68)

	at
org.eclipse.gmf.runtime.draw2d.ui.render.internal.AbstractRenderedImage.getSWTImage(AbstractRenderedImage.java:130)

	at
org.eclipse.gmf.runtime.draw2d.ui.render.internal.RenderHelper$1.run(RenderHelper.java:103)

	at java.lang.Thread.run(Thread.java:797)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40927] - DOMUtilities#deepCloneDocument(Document, DOMImplementation) returns corrupted document

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40927





------- Additional Comments From aboyko@ca.ibm.com  2006-11-08 11:44 -------
Created an attachment (id=19101)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19101&action=view)
SVG_flat.svg

Image that does NOT give the exception

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40927] - DOMUtilities#deepCloneDocument(Document, DOMImplementation) returns corrupted document

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40927


aboyko@ca.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From aboyko@ca.ibm.com  2006-11-13 14:49 -------
Although, I couldn't verify this properly with the latest source code, I 
noticed that the exception is not thrown any more 
for "SVG_gradient_noattr.svg" image by the transcoder after cloning. Hence 
marking the bug as invalid.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40927] - DOMUtilities#deepCloneDocument(Document, DOMImplementation) returns corrupted document

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40927





------- Additional Comments From aboyko@ca.ibm.com  2006-11-08 11:45 -------
Created an attachment (id=19102)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19102&action=view)
SVG_gradient_noattr.svg

Image that does give the exception

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40927] - DOMUtilities#deepCloneDocument(Document, DOMImplementation) returns corrupted document

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40927





------- Additional Comments From deweese@apache.org  2006-11-11 03:30 -------
Hi Alex,

   I suspect that this bug is fixed.
   The problem is that when we clone a document we do 
not propogate the document URL (Document.getDocumentURI()),
there has been some discussion if this is correct or not,
personally I think it's ok.  The bug was that the linear
gradients wouldn't properly resolve local refs if the
document lacked a base URL.  This bug has been fixed
in SVN.  

   Can you check trunk and see if your problem goes
away?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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