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

Splitting a single DITA file into multiple topics

Community Expert ,
May 02, 2019 May 02, 2019

Copy link to clipboard

Copied

Hi All,

I have a client with a series of DITA concepts that are really chapters containing a bunch of nested concepts. For example, one file is a concept with 70 nested concepts. They want to split each chapter into topics and create ditamaps and maintain all cross-references, etc. It is not really a project that I want to tackle right now. It seems that an XSLT solution would be the best. If anyone has a good algorithm for this or would be interested in taking on this project, please let me know. Thank you very much.

Rick

TOPICS
Scripting

Views

1.6K

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
Advocate ,
May 02, 2019 May 02, 2019

Copy link to clipboard

Copied

Hi Rick,

I have done a wide variety of such projects - taking files apart and even reassembling them. It would be easy enough to work on this type of project, using a combination of XSLT and ExtendScript if that is required.

Send me a mail - I do not seem to have your current contact details.

4everJang

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
Advocate ,
May 02, 2019 May 02, 2019

Copy link to clipboard

Copied

One project actually took a huge DocBook file, converted it into 400+ topics, assembled those into 40 chapters using text insets and reassembled the changed files into a new DocBook file.

The things customers make you do for money... 🙂

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 ,
May 02, 2019 May 02, 2019

Copy link to clipboard

Copied

rick at frameexpert dot 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
New Here ,
Feb 28, 2020 Feb 28, 2020

Copy link to clipboard

Copied

LATEST

(I found this post while looking for an answer myself so here's what I learned)

The simplest way to split nested dita topics is to add chunk="by-topic" to all the topicrefs in the map and then use the "normalize" plugin in DITA OT to split out the individual topics.

 

For example:
1. In map.ditamap, add @chunk attribute: <topicref href="content.dita" chunk="by-topic"/>
2. From the commandline, run DITA OT on the ditamap: <dita-ot-dir>/bin/dita -input map.ditamap -format dita

The split dita topics and map (with references to all the split topics) are written to the "out/" directory. The topic @id is used as the filename for each topic. And, if you have topics in subdirectories, the split topics are also written to the same subdirectories. So it all works very nicely.

 

Note: The normalise plugin is built-in to the latest DITA OT (3.4) but if it's not in your DITA OT you can install it from here: https://github.com/dita-ot/org.dita.normalize

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