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

Data Merge Automatic XML Tags

Explorer ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

So I am encountering an issue I have never seen, after using Data Merge for the past 3 years. I am trying to automate some of our design outputs by creating a script that allows a non-designer from our company to fill out information and then we can run the scripts and remove a lot of the tedious work and get us to a finished publication faster.

 

My issue is when it merges. the pre-merge document does not have any XML tags associated with it, but after merging everything is automatically tagged. it is throwing the script off and I am unsure how it is getting auto-tagged. This is a new issue for me.

 

Does anyone know why data merge might be doing this. I have tried googling and across different forums come up with nothing.

 

Thanks

 

TOPICS
Scripting

Views

270

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

Community Expert , Oct 06, 2020 Oct 06, 2020

Hi Robert,

you say:

"My issue is when it merges. the pre-merge document does not have any XML tags associated with it, but after merging everything is automatically tagged. it is throwing the script off and I am unsure how it is getting auto-tagged. This is a new issue for me."

 

That's the typical behavior of a data merge result where the data merge template is built with data merge placeholders on master pages. Move the data merge placeholders to a document page and you are good to go.

 

Regar

...

Votes

Translate

Translate
Advisor ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

Hello Robert!

 

What version of Indesign are you running?  I'm currently on 15.1.2

I've seen this in the past also but not lately and I can remember what I did to fix it, try saving a new .csv file.

The below snippet will remove the tags,  you can run it before you run your script or add it into your existing code.

 

var doc = app.documents[0];  
  
doc.xmlElements[0].xmlElements.everyItem().untag();  

var tempRect = doc.rectangles.add();
  
tempRect.markup(doc.xmlElements[0]);  
 
tempRect.remove(); 

Regards,

Mike

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
Advisor ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

Hello Robert!

I updated the snippet to remove the the tags from the tags pannel as well.

 

var doc = app.documents[0];  
  
doc.xmlElements[0].xmlElements.everyItem().untag();  

var tempRect = doc.rectangles.add();
  
tempRect.markup(doc.xmlElements[0]);  
 
tempRect.remove();

doc.deleteUnusedTags();

Regards,

Mike

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
Explorer ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

Thanks for the reply Mike, I am currently on 15.0.1 and due to company IT policies can not control my updating schedule. I'll do some more testing tomorrow and check the CSV file. I've tried a few save outs of it but may try building one from scratch to see if that is an issue.

 

I appreciate the tag remover snippet, I was hoping to not need something like that

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
Community Expert ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

LATEST

Hi Robert,

you say:

"My issue is when it merges. the pre-merge document does not have any XML tags associated with it, but after merging everything is automatically tagged. it is throwing the script off and I am unsure how it is getting auto-tagged. This is a new issue for me."

 

That's the typical behavior of a data merge result where the data merge template is built with data merge placeholders on master pages. Move the data merge placeholders to a document page and you are good to go.

 

Regards,
Uwe Laubender

( ACP )

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