0
Community Beginner
,
/t5/indesign-discussions/xml-error-namespace-attribute/td-p/10384696
Feb 19, 2019
Feb 19, 2019
Copy link to clipboard
Copied
I am outputting an SVG file using indesign javascript and when I try to execute the following line in the newest indesign cc version I get an error. However, it works in CS5. I suspect it has something to do with not defining a namespace that I am using in an attribute but I am not sure how to define it.
code that is giving an error:
new XML('<image xlink:href="' + imgName + '" />');
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
People's Champ
,
Feb 21, 2019
Feb 21, 2019
var x = <image/>;
var ns = new Namespace ("xlink", "http://www.someuri.com/1.0");
x.addNamespace (ns);
x["@xlink:url"] = "tutu.jpg";
alert(x.toXMLString());
People's Champ
,
LATEST
/t5/indesign-discussions/xml-error-namespace-attribute/m-p/10384697#M136156
Feb 21, 2019
Feb 21, 2019
Copy link to clipboard
Copied
var x = <image/>;
var ns = new Namespace ("xlink", "http://www.someuri.com/1.0");
x.addNamespace (ns);
x["@xlink:url"] = "tutu.jpg";
alert(x.toXMLString());
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

