Rob Davis-5 <[EMAIL PROTECTED]> wrote on 03/13/2008 05:38:41 AM: > > To solved this I've binned using batik's own parser and am using the DOM > LSParser instead.
Well really it's just that you have bypassed Batik's wrapper around the parser so you can get some of the intermediate information. Note that you still don't get the DOCTYPE reflected in the DOM or anything you are just 'saving' it from the parsing operation. > The comments are still omitted, however but that is a minor issue. The comments (like the DOCTYPE) are omitted because there is no place in the DOM to store them. Since our parser returns a DOM there is no way to return them to you. In anycase DOCTYPEs are on the way out, to be replaced with schema tied to namespaces. > But I think I'm onto a winner because with the DOM LSParser I've got > full control and not things hidden away or over customized as it > seems with the batik parser. Sure, you have also replaced 3 lines of code with ~100, so I hope you get something in return ;). It's worth noting that there is no 'batik parser' we simply wrap a standard XML parser to make it easier for folks to build an SVG DOM (we also take care of providing known SVG DTD's locally etc.) One issue with your code is that you are build an LS DOM rather than a Batik/SVG DOM. This is potentially a performance issue because batik must clone your document to render it (as it needs the CSS and SVG DOM interfaces). If you aren't going to render the document then this isn't an issue.
