Gisellameloni / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

setSvgString() error #1256

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I use getSvgString() to get svg string in canvas and save it into a 
javascript  variable
2. and I add an  <a  xlink:href="...">tag into this variable
3. then I use setSvgString() to set this new svg string to the canvas

What is the expected output? What do you see instead?

error happened : 
code: 3
message: "Failed to execute 'insertBefore' on 'Node': Nodes of type 'head' may 
not be inserted inside nodes of type '#document'."
name: "HierarchyRequestError"

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)
ALL

In what version of SVG-edit does the problem occur? (Latest trunk, 2.7.1,
etc)
2.6

Please provide any additional information below.
some url are insert into cavas correctly(ex.https://www.coursera.org/courses),
but some aren't(ex. 
http://ocw.nctu.edu.tw/course_detail.php?bgid=1&gid=1&nid=490)
I don't know how to deal with this problem, please help me  ~~ thank you

Original issue reported on code.google.com by lihu2...@gmail.com on 29 Dec 2014 at 8:44

GoogleCodeExporter commented 9 years ago
I don't have a lot of time for assisting here, but I could at least chime in 
that setSvgString attempts to make a complete XML document, and if you have 
added a link into the variable without ensuring it is well-formed XML (e.g., if 
you have added a link without ensuring there was only one root node), then you 
could have a problem. At what line did the error occur? And can you please try 
on the latest release (2.7.1) and give the line number from there. You may also 
need to ensure that the "xlink" namespace has a namespace declaration since XML 
requires it (i.e., xmlns:xlink="...").

Original comment by bret...@gmail.com on 5 Jan 2015 at 9:42