Re: ERROR: JSVGCanvas.setDocument() method

2009-12-31 Thread dao
That's correct. I followed the code snippet given in the thread create a
JSVGCanvas from an inputstream
And now everything is OK.

On Thu, Dec 31, 2009 at 3:39 AM, thomas.dewe...@kodak.com wrote:

 Hi Dao,

 dao dao.ho...@gmail.com wrote on 12/29/2009 07:49:28 AM:

  do I have to set manually some properties to the builder?

It's possible you need to enable namespaces or something.
 However if you use our DocumentFactory (yes the
 org.apache.batik.dom.svg.SAXSVGDocumentFactory), I suspect
 all of your problems will go away.

  On Tue, Dec 29, 2009 at 12:15 AM, dao dao.ho...@gmail.com wrote:
  I don't get why I have a namespace problem.
 
  The string representing the doc is created in the server side like this
 
  private static String formatDoc(SVGDocument doc) throws IOException {
  StringWriter stringWriter = new StringWriter();
  org.apache.batik.dom.util.DOMUtilities.writeDocument(doc, stringWriter);
  stringWriter.flush();
  stringWriter.close();
  return stringWriter.toString();
  }
 
  public String getSvgDocument() throws RemoteException {
  try {
  return formatDoc(getCanvas().getSVGDocument());
  } catch (IOException e) {
  throw new RemoteException(could not format the document,e);
  }
  }
 
  Why it does not contain the namespaces when I reread the string?does
  the writeDocument is not the right way to serialize a document?
 
  And by talking about the DocumentFactoryImplementation, you
  mean org.apache.batik.dom.svg.SAXSVGDocumentFactory ?
 
  By the way, thank's for the several answers or directions you often
  give to me, they have largely contributed to my project.
 

  On Mon, Dec 28, 2009 at 4:14 PM, thomas.dewe...@kodak.com wrote:
  Hi Dao,
 
  dao dao.ho...@gmail.com wrote on 12/28/2009 07:12:30 AM:
 
   I get This exception
  
   java.lang.ClassCastException: org.apache.batik.dom.GenericElement
   cannot be cast to org.w3c.dom.svg.SVGSVGElement
   at org.apache.batik.dom.svg.SVGOMDocument.getRootElement
   (SVGOMDocument.java:233)

  Almost certainly this is a problem with namespaces (so your
  root element might be an svg element but not an svg:svg element).
 
  Also you aren't using our DocumentFactory implementation,  this
  is at least a performance hit.
 
   When I do this, it is all right. What's wrong?
  
   public CanvasProxy(long fps, String rmiRegistryLocation) throws
   NotBoundException, ParserConfigurationException, SAXException,
 IOException {
   connect(rmiRegistryLocation);
   canvas = new JSVGCanvas();
   canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
   canvas.setURI(remoteEngine.getSvgDocumentURI().toString());
   --
   Dao Hodac
 
 

  --
  Dao Hodac
 
 
 
  --
  Dao Hodac




-- 
Dao Hodac


contribution advice?

2009-12-31 Thread jonathan wood
Happy New Year Batikeers,

I have a few enhancements I'd like to add to batik, but I'm not quite
finished scoping/designing in that arena.  In the meantime, I'm starting to
absorb more of the core code.  I find it usually helps me if I have a goal.
Perhaps someone familiar with the current state of batik's bug list
(Helder???) could point me toward some validated, higher priority bugs so
that I might attempt to resolve?

  My Apache ICLA has been submitted and I do understand that I will be
limited to submitting patches that may or may not be applied by an
individual with commit access.


  Thanks,

jonathan