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

Convert XML tag to index entry in InDesign?

New Here ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

I want to upgrade our university's graduation book using InDesign instead of an ancient version of FrameMaker. Each student is listed in the book with their name, major, minor, thesis title, etc. At the end of the book is an index with each student's name. The data for the book is in an XML file, and I know how to import the XML and use tags, styles, etc. to format it. However, I'm struggling to figure out how to create the index entries.

 

The XML file already includes a tag for index name, e.g.:

 

<STUDENT>

<STUD_NAME>Jennifer Gabrielle Smith</STUD_NAME>

<INDEX_NAME>Smith, Jennifer G.[SMITH, JENNIFER GABRIELLE90210]</INDEX_NAME>

<STUD_TITLE>This is the student's thesis title</STUD_TITLE>
</STUDENT>

 

What is the best method for changing the content within the <index_name> tag (except for what's in straight brackets) to an index entry? Obviously it's not practical to hand-tag thousands of students. Do I have to use a script, or is there some other simpler way?

TOPICS
Scripting

Views

410

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 21, 2020 Oct 21, 2020

Then you will need to use a script, perhaps this one may work. You would apply a character style to the Index name and then run the script.

Votes

Translate

Translate
Community Expert ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

Your example seems more of a table of contents, than an index.

Will it look like this?
Smith, Jeff  p250

Smith, Jennifer  p251

Smith, John  p252

If yes, then use a unique paragraph style applied to your Index name entries, and then use the Table of Content tool to generate the list.

 

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
New Here ,
Oct 21, 2020 Oct 21, 2020

Copy link to clipboard

Copied

Thanks, Jeffrey. Close, but not quite. Table of Contents doesn't alphabetize the listings, nor does it include references to multiple pages for the same student. For example, Jennifer Smith might have a double major and be listed twice, on p251 and p17, so the entry should look like:

 

Smith, Jennifer     17, 251

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 21, 2020 Oct 21, 2020

Copy link to clipboard

Copied

Then you will need to use a script, perhaps this one may work. You would apply a character style to the Index name and then run the script.

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
New Here ,
Oct 22, 2020 Oct 22, 2020

Copy link to clipboard

Copied

LATEST

That is indeed the perfect script, thanks so much!

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