You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by gurks <r....@gmx.at> on 2007/08/31 09:51:41 UTC

Parse exception on document reload ... further observations

I made some further observations related to this problem. When I open up my
document several times
sometimes some parts of the document are drawn wrong e.g. rectangles are
filled with a color that 
shouldn't be filled or elements are missing. Closing and opening up the
document again results in 
another drawing. Most of the time it is drawn right but sometimes it's not.
I think the wrong drawing is
an effect of the parse errors I mentioned.

Another observation I made is the loading time. First time I open the
document it needs a second or 
two to draw the picture. But next time I do this everything goes faster.
That's why I believe that 
somewhere the document is cached (but eventually with errors because of the
error messages I 
posted yesterday).

Does anybody have a similar problem?

-- 
View this message in context: http://www.nabble.com/Parse-exception-on-document-reload-tf4352768.html#a12421784
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Parse exception on document reload ... kind of "solution" ;)

Posted by gurks <r....@gmx.at>.
Playing around a little bit I found out that the SVG syntax error occured on
making a deep copy of the
document (cloning). So I tried to write the clone to hard disc to check the
svg output directly. But
after writing the file to disk the error never occured again :) I don't know
what was the problem but
I worked around it now by sending the cloned document into a
ByteArrayOutputStream. The
performance seems to be no problem so I'm happy with this "solution" even
it's not very beautiful ;)

Here is my code:

SVGDocument docClone = (SVGDocument) doc.cloneNode(true);	
try {
   ByteArrayOutputStream stream = new ByteArrayOutputStream();
   OutputStreamWriter writer = new OutputStreamWriter(stream);
   DOMUtilities.writeDocument(docClone, writer);
   writer.close();
   stream.close();
} catch (Exception ex) {
 
}

-- 
View this message in context: http://www.nabble.com/Parse-exception-on-document-reload-tf4352768.html#a12474608
Sent from the Batik - Users mailing list archive at Nabble.com.


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