Apply template to existing topic

Oxygen general issues.
JulieP
Posts: 16
Joined: Sat May 30, 2015 2:18 am

Apply template to existing topic

Post by JulieP »

Hello. Is there a way to apply a template to an existing topic?
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Apply template to existing topic

Post by alex_jitianu »

Hi,

First, let's be sure that I understand the requirement. You have a new document topic that imposes a certain structure and an already existing topic that doesn't respect this structure. You want to refactor the existing topic to respect the template structure? Is this the use case? If not, please give me more details.
Best regards,
Alex
JulieP
Posts: 16
Joined: Sat May 30, 2015 2:18 am

Re: Apply template to existing topic

Post by JulieP »

HI Alex! Yes, that is the use case. For example, the new template would have metadata and sections with specific titles that the existing topic should have.
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Apply template to existing topic

Post by alex_jitianu »

Hi,
In theory it could be done wither though a custom XML refactoring action or through a prompt in our AI Positron add-on. To decide which path is more feasible, could you send us some sample files on support@oxygenxml.com? After we make the analysis I will remove the files from my system. You can also use the action Help->Support tools->Randomize XML text content before sending the files if they contain sensitive information.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Apply template to existing topic

Post by chrispitude »

Hi JulieP,

If you want to insert metadata into an existing topic that might or might not have it, the following Oxygen XML Blog post might be useful:

Inserting and Reformatting Content in Refactoring Operations

We used it for exactly that purpose. Some topics had a <prolog> and some did not. We needed a reliable way to create or reuse metadata structures as needed, while respecting DITA content models.

If you are talking about content restructuring, that would probably require some other approach, such as the ones Alex suggested.
Post Reply