Skip to main content
RobOctopus
Inspiring
Oct 5, 2020 7:47 PM UTC
Answered

Data Merge Automatic XML Tags

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

 

This topic is closed to new replies. Start a new post to keep the conversation going.
LaubenderCorrect answer
Community Expert
Oct 6, 2020 1:17 PM UTC

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 )

5 replies

LaubenderCommunity ExpertCorrect answer
Community Expert
Oct 6, 2020 1:17 PM UTC

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 )

Translate
Participant
Nov 15, 2024 9:55 PM UTC

Leaving a comment to let you know that this solution helped me out in a big way! Thank you!

Translate
Legend
Oct 5, 2020 9:30 PM UTC

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

Translate
Legend
Oct 6, 2020 12:52 AM UTC

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

Translate
RobOctopus
Inspiring
Oct 6, 2020 3:28 AM UTC

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

Translate