Hi Loicrollus, [EMAIL PROTECTED] wrote on 04/21/2007 09:27:56 AM:
> The String with the new data that I receive looks like this: > > "<g id="101"> This 'g' needs to have the xmlns attribute: <g id="101" xmlns="http://www.w3.org/2000/svg"> > <polyline style="fill:none; stroke:rgb(255,000,000);" points="8325 > 2232, 8325 2540"/> > <polyline style="fill:none; stroke:rgb(255,000,000);" points="8445 > 2232, 8425 2530"/> > ... > </g>" > > So I parse it and I put it into a document. Right but the parser puts it all in the no-name namespace. > I try: > > 1) > Element bRoot = (Element)b.getDocumentElement(); //get "g" > bRoot.setAttribute("xmlns","http://www.w3.org/2000/svg"); Setting this attribute after the parse has no effect, it has to be in the parsed content. > => doesn't work > > 2) > To add an "svg" element to the string. > "<svg xmlns="http://www.w3.org/2000/svg"> If this doesn't work then there is something wrong with how you were using it, because it should work. You can find out what the namespace of the element is with by calling "String getNamespaceURI()" on the element. How are you parsing the string? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
