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

How to insert an XML element at given word?

New Here ,
Nov 26, 2015 Nov 26, 2015

Copy link to clipboard

Copied

I want to know the best way to insert xml elements inside an InDesign document. Presently I am taking the following steps:-

1. Create a tag if it doesn't exists already.

2. Create an element using the tag above as child of the root element.

3. Move the new element to the desired word or text location inside a TextFrame.

The above steps work correctly but not all the time. Many times I get an error that says "The element cannot be moved to the destination.".

So, first two steps work without an error but third step some times throw the above stated error. Due to this exported xml shows all the unsuccessfully moved elements at the end of the root element. I want to know the possible reason behind this error. Please help me as I need to solve this issue ASAP.

TOPICS
Scripting

Views

317

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
Engaged ,
Dec 01, 2015 Dec 01, 2015

Copy link to clipboard

Copied

Hi,

have you tried to markup the given word:

var wordTag = curDoc.xmlTags.itemByName(wordTagName);

var wordXmlElement = rootXmlElement.xmlElements.add(wordTag);

curWord.markup(wordXmlElement);

If you move the XmlElement you change the structure of the document

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
People's Champ ,
Dec 02, 2015 Dec 02, 2015

Copy link to clipboard

Copied

LATEST

Many times I get an error that says "The element cannot be moved to the destination.".

Are you possibling trying to markup a text which could:

a) be hidden (overflowing text)

b) be on a locked layer

c) be on a hidden layer

d) be locked (textframe locked)

?

Loic

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