On Wednesday 31 October 2001 10:57, Keiron Liddle wrote:
> On 2001.10.30 16:41 Stephane Hillion wrote:
> > It is difficult to help you without some examples or pieces of code.
> > But what you must have in mind is that the xmlns attribute and prefix is
> > used
> > by XML parsers to bind elements to namespaces, and once you are in the
> > DOM
> > world it is not used anymore.
> > To make the importation work, you must be sure that all the elements of
> > the
> > SVG fragment were in the SVG namespace at creation time.
>
> I have attached some code and an example svg file. This should indicate
> what I am trying to do.
> Note the xmlns attribute is repeated on some of the svg elements.
>
> So how do I make sure that all the elements are in the svg namespace at
> creation time, the example (I would have thought) does this but the
> namespace uri of the elements is still null. (I am using xalan 2.2d11
> xerces 1.4.3 and current cvs batik)
>
> From what you said it sounds like it is not possible and batik won't let me
> do it.
> I could not repeat the npe, it must be a combination of a number of
> factors.

All your troubles comes from the fact that the DocumentBuilder instances you 
use are not namespace aware. So just configure a DocumentBuilderFactory by 
calling its setNamespaceAware() method and the DocumentBuilder objects 
created will build correct DOM level 2 trees.
--
  Stephane.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to