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

Is this possible Add XML Tag to Table columns

Engaged ,
Mar 15, 2016 Mar 15, 2016

Copy link to clipboard

Copied

Hi EveryOne!

I am the new baby to this indesign forums. I need apply XML tag to each and every table columns (name likely test1,test2...)

Please help me out this problem or kindly correct my codes.

-yajiviki

My code.

var docRef=app.activeDocument;

var ColLen=app.activeDocument.stories.everyItem().tables.everyItem().columns.length;

for(i=0; i<ColLen; i++){

    var mySel=app.activeDocument.stories.everyItem().tables.everyItem().columns;

    app.activeDocument.xmlElements[0].xmlElements.add({markupTag:"Test"+(i+1), xmlContent:mySel});

}

TOPICS
Scripting

Views

268

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 , Mar 15, 2016 Mar 15, 2016

Hi,

You can easily tag the table at first with the autoTag command.

myTable.autoTag();

Once that done, you can target the columns cells and reset the applied tag:

var xes = myTable.columns[0].cells.everyItem().associatedXMLElement;

var n = xes.length;

while ( n-- ) xes.markupTag = "foo"

HTH

Loic

www.ozalto.com

Votes

Translate

Translate
People's Champ ,
Mar 15, 2016 Mar 15, 2016

Copy link to clipboard

Copied

LATEST

Hi,

You can easily tag the table at first with the autoTag command.

myTable.autoTag();

Once that done, you can target the columns cells and reset the applied tag:

var xes = myTable.columns[0].cells.everyItem().associatedXMLElement;

var n = xes.length;

while ( n-- ) xes.markupTag = "foo"

HTH

Loic

www.ozalto.com

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