Key definitions for variable text: Conditional processing

Kristen James Eberlein

Hi, dita-users community.

I have another question about variable text defined by keys. (Variable text is is text that you want to appear differently based on the context.)

For implementations that use keys to define variable text:

  1. How do you handle conditional processing of the key definitions?
  2. What markup are you currently using for this?

Again, for DITA 2.0, the DITA TC is introducing simplified markup and processing for variable content referenced using keys. I am soliciting background information that will help us ensure that we are covering relevant use cases in the best way.


Kristen James Eberlein
Chair, OASIS DITA Technical Committee
OASIS Distinguished Contributor
Principal consultant, Eberlein Consulting LLC
+1 919 622-1501; kriseberlein (skype)


We have two levels of conditional processing.  Either we want different variable values, or we want different overall statements.  For example, we might say <p audience= "Bar">The <ph keyref="FOO"/> is a whizbang.</p> 

If we want FOO to express different things, we use a different keydef map.  For example, we OEM to different companies, and we need FOO to give the correct product name.  To do that we use a different set of keydefs.  Note that we transform in the browser, and actually show our content in the GUI.  We include the keydef map in a set of branding files that we pick up at build time, so all the variables come out right.

Now let's say that Bar is for a product level, or a customer role.  We use ditaval files for PDF generation, and that comes out fine.  We also implement filtering in our browser-based transforms, so we can hide the content as needed.  For some types of audience filtering, we can preset that in the build.  Other types depend on the current state of the user/product relationship...  We get the state and then inject the filtering in our system at run time.