Hi Dao, dao <dao.ho...@gmail.com> wrote on 05/17/2010 10:02:50 AM:
> adding a fragment of SVG to a document [...] > I have a canvas with a loaded document (ALWAYS_DYNAMIC) > I want to add this piece of SVG (value of the text variable): > <text id="fooText" ...>FOO</text> > > but then, the returned node is null (createDocument fails). I > suppose <text> is not enought, I have to specify it is SVG. Correct. > Then, I surrounded the text tag with a <!DOCTYPE..><svg> ... </svg> > and it works well. BTW you should only need the <svg>...</svg>. > But when I look to my SVG document, it contains > the SVG tag. Well it was there in the input. > How can I have this:? Use the Dom's methods to get the 'firstChild' of the returned document's root element, and append that.