Highlighted

Data Merge Automatic XML Tags

New Here ,
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

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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 )

TOPICS
Scripting

Views

77

Likes

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

Data Merge Automatic XML Tags

New Here ,
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

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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 )

TOPICS
Scripting

Views

78

Likes

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

Likes

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
Reply
Loading...
Oct 05, 2020 0
Engaged ,
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

Likes

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
Reply
Loading...
Oct 05, 2020 0
New Here ,
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

Likes

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
Reply
Loading...
Oct 05, 2020 0
Adobe Community Professional ,
Oct 06, 2020

Copy link to clipboard

Copied

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 )

Likes

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
Reply
Loading...
Oct 06, 2020 1