Delete and replace XML-tag


how delete xml tag , replace using script? there's function adding tags document (activedocument.xmltags.add("xml-tag")), can't find corresponding function delete it, , replace in gui.

 

i tried accomplish changing name of tag 1 wanted using code below, throws error: "a tag name exists.  please choose different name."

 

for(var i=0;i<xmltags.length;i++){      xmltags[i].markuptag.name = "existing-xml-tag"; } 

does know of way go around error or should use method entirely?

ok, wasn't difficult solve. looking @ wrong place that's all. remove(replacewith) function available xmltag class. meaning followin code removes tag called "p-new-section" , replaces existing tag called "p".

 

mydoc.xmltags.itembyname("p-new-section").remove("p"); 


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account