I am trying to avoid having to import (and thus clone) the nodes for performance reasons, hence this setup.
sorry for continuously replying to my own posts, i am just trying to a deeper understanding of something obviously not so trivial.
Any pointers? Jorg
Jorg Heymans wrote:
i just switched to xerces 2.6.2, it didn't help so my suspicion about namespaces seem to be correct.
Batik is rightfully ignoring any element that is not created with the SVG namespace. But i do create a text document with correct prefixes everywhere, and i made sure the client parser sees them (debugging the contenthandler i can see that every startelement() has the correct URI with it).
Could the transformerfactory maybe drop them ? I create it as following:
SAXTransformerFactory factory = TransformerFactory.newInstance();
TransformerHandler handler = factory.newTransformerHandler();
handler.setResult(new DOMResult(parentnode)) -> parent node is the element i created from the SVGDoc
I hope these snippets make sense.
Regards Jorg
Jorg Heymans wrote:
Hi,
I am having a problem getting my canvas updates to appear. I know the common pitfalls and i think i avoided them, hence my post.
Here is what i am doing
- a servlet creates a stream of xml data, parts of this xml data is used to build the SVG document, other parts not. I made sure that the servlet declares the namespace prefixes at the begining of the doc, and that all elements (not the attributes) used for the SVG doc have the svg namespace prefix.
- a client canvas retrieves this stream and does the following
1)create a reader using crimson's o.a.crimson.parser.XMLReaderImpl, making sure it has namespace and namespaceprefix support
2)setup a content handler that uses a SAX to DOM transformer
3)parse the stream using the content handler, resulting in a DOM tree of the SAX stream.
The content handler appends the parsed nodes to an element that is created from the current active SVGDocument (thus avoiding having to import and clone them afterwards).
I then move the newly created elements from this element to the relevant nodes in the SVGDocument (in the canvasmgr update thread). The updates aren't showing for some reason. But if i dump the updated svg doc to a file and load it into squiggle it shows up fine :(
I believe there are namespace issues involved here, either i don't set it correctly or batik does not see it. What can i do to debug this?
Regards Jorg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
