Jim Ley wrote:
Hi,
With my SVG application, I currently only have 1 issue with Batik 1.5beta 5 serious enough that I need to fork the script to seperate ASV from Batik:
a=parseXML("<xml/>",null)
This works in ASV for creating a new document, however in Batik it produces an error, and you can only produce documentFragments by having the second parameter be the SVG document (which doesn't work properly in ASV, and isn't really neat when you have a standalone document.
Is this simply not yet implemented in Batik, or is it a bug?
So the problem here is that in Java (strongly typed language) parseXML is defined to
return a DocumentFragment. In fact we currently parse the string into it's own document
then import it as a document fragment into the provided Document.
Please remember that this is an 'Adobe extension' (admittedly useful one) so there really is no solid definition of the function, and as usual things are never as easy as they seem.
The issue I ran into was cases like: a = parseXML("<rect x="10" y="10" width="100" height="50"/>", null);
This can not return an SVG document (root element of an SVG Document must be an
'svg' element), but it could return an SVG fragment. This has implications on the namespace
of the 'rect' element, it will be different if given a base document or not. I think this is 'the
right thing to do' but I wanted to make sure people agree.
If the base document is provided and it is an SVG document then the resulting 'rect'
element will be an svg rect (in the svg namespace) in a Document Fragment. Othewise it
will become the root element of a generic XML document (if doc is null) or a generic
XML Document Fragment (if doc is not an SVG document) and not have any associated
namespace.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]