• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

XML error namespace attribute

Community Beginner ,
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

Views

417

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 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());

Votes

Translate

Translate
People's Champ ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

LATEST
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());

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines