Hi Loic, [EMAIL PROTECTED] wrote on 04/23/2007 04:57:25 AM:
> The String "newLayer": > ---------------------------------------------------------------- > <g id="101" xmlns="http://www.w3.org/2000/svg"> Ok, looks good. > The parsing > ---------------------------------------------------------------- > InputSource is2 = new InputSource(new StringReader(newLayer)); > DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); > DocumentBuilder db = dbf.newDocumentBuilder(); > Document newDocument = db.parse(is2); Probably also ok, not sure if you need to do anything to make the parser namespace aware. I wouldn't think so... > //document is the Document from the Jsvgcanvas > Element root = (Element)document.getDocumentElement(); > //a1 is the child of the "svg" tag. It's a kind of root element > Node a1 = document.getElementById("1"); > > //it's the <g id="101"> element > Element rootNewDocument = (Element)newDocument.getDocumentElement(); > > //give me: Element:g Namespace:null > System.out.println("Element:" + rootNewDocument.getTagName() + " > Namespace:" + rootNewDocument.getNamespaceURI()); Something is wrong here. > The document when I serialize it > ---------------------------------------------------------------- > <g id="101"> Something is _very_ wrong here. Even if the parser isn't namespace aware it can't strip attributes (note it's missing the xmlns attribute). I suspect you aren't parsing the string you think you are parsing... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
