Local overrides of reused content


timathom@...
 

Hello,

I am new to DITA and still learning the ropes (working in oXygen XML Editor v23). I have a question about content reuse: I have a set of reference topics, and I would like to reuse a common prolog block with standard metadata for all topics. However, each reference document needs to have a different source attribution. I know that I can do this:

<prolog>
    <author conkeyref="common/author_ref"/>
    <source>[Variable source info]</source>
    <publisher conkeyref="common/pub_ref"/>
    <critdates conkeyref="common/dates_ref"/>
    <metadata conkeyref="common/metadata_ref"/>
</prolog>

But rather than having to reference individual elements, I was wondering whether there was a way to reference the whole prolog and override the source element locally, like this:

<prolog conkeyref="common/prolog_ref">
  <source conaction="pushreplace" conkeyref="common/source_ref">[Variable source info]</source>
</prolog>


Of course, this only works from a single document because the common topic keeps getting overwritten by each push. Is there a way to do local overrides of reused content in DITA that I'm missing?

Thank in advance,
Tim


--
Tim A. Thompson
Librarian for Applied Metadata Research
Yale University Library


 

Hello Tim,

You could do this type of thing by adding all possible content to the prolog and using profiling attributes to filter out the ones you do not want to see. Another option - if your variable source info is stored in a database - is to use my forthcoming Smart Product Data product, which allows you to an element in your DITA to items in a database. You can then define the item to be retrieved at the topic level, causing the right source information to be pulled into the <prolog> of every topic. I am still working on completing the product (need to create a GUI for <oXygen/> and complete the one for FrameMaker) but the basic method works and it looks like you could set the attribute values manually without running into trouble. It would be interesting to see a real-life solution based on my product. Check out the info on smartdata dot world and drop me a message if you are interested. 

Kind regards

Jang F.M. Graat

Smart Information Design
Amsterdam, Netherlands


ekimber@contrext.com
 

If your content structure allows, you can do this by using a keyref from the re-used content and then have the key set to different values in different key scopes.

 

For example, in your reusable prolog block (in a warehouse topic) you would have something like:

 

<prolog>
    <author >Ann Author</author
    <source><ph keyref=”variable.source”/></source>
    <publisher>We Make Stuff</publisher>
    <critdates >…</critdates>
    <metadata >…</metadata>
</prolog>

 

And then your map or maps you can have different declarations for the key “variables.source”:

 

Map A:

 

<map>

  <topicgroup keyscope=”variable”>

     <topicmeta><navtitle>Keys for “variables”</navtitle></topicmeta>

     <keydef name=”source”>

       <topicmeta><linktext>Source A</linktext></topicmeta>

    </keydef>

  </topicgroup>

  <topicgroup keyscope=”reuse”>

     <topicmeta><navtitle>Warehouse Topics</navtitle></topicmeta>

     <keydef keys=”prologs” keyref=”reuse/prologs-warehouse.dita”/>

  </topicgroup>

     …

    <topicref href=”topics/topic-that-uses-proplog-01.dita”/>

</map>

 

Map B:

 

<map>

  <topicgroup keyscope=”variable”>

     <topicmeta><navtitle>Keys for “variables”</navtitle></topicmeta>

     <keydef name=”source”>

       <topicmeta><linktext>Source B</linktext></topicmeta>

    </keydef>

  </topicgroup>

  <topicgroup keyscope=”reuse”>

     <topicmeta><navtitle>Warehouse Topics</navtitle></topicmeta>

     <keydef keys=”prologs” keyref=”reuse/prologs-warehouse.dita”/>

  </topicgroup>

     …

    <topicref href=”topics/topic-that-uses-proplog-01.dita”/>

</map>

 

If the topic is used multiple times in a single map then you use distinct key scopes within the map and within each key scope define a different value for the source key.

 

Cheers,

 

E.

 

--

Eliot Kimber

http://contrext.com

 

 

 

Hello,

I am new to DITA and still learning the ropes (working in oXygen XML Editor v23). I have a question about content reuse: I have a set of reference topics, and I would like to reuse a common prolog block with standard metadata for all topics. However, each reference document needs to have a different source attribution. I know that I can do this:

<prolog>
    <author conkeyref="common/author_ref"/>
    <source>[Variable source info]</source>
    <publisher conkeyref="common/pub_ref"/>
    <critdates conkeyref="common/dates_ref"/>
    <metadata conkeyref="common/metadata_ref"/>
</prolog>

But rather than having to reference individual elements, I was wondering whether there was a way to reference the whole prolog and override the source element locally, like this:

<prolog conkeyref="common/prolog_ref">
  <source conaction="pushreplace" conkeyref="common/source_ref">[Variable source info]</source>
</prolog>


Of course, this only works from a single document because the common topic keeps getting overwritten by each push. Is there a way to do local overrides of reused content in DITA that I'm missing?

Thank in advance,
Tim


--
Tim A. Thompson
Librarian for Applied Metadata Research
Yale University Library


timathom@...
 

Thanks very much, Eliot and Jang! I will experiment with using key scopes for this use case.

All best,
Tim


--
Tim A. Thompson
Librarian for Applied Metadata Research
Yale University Library