Documentation Center

Creating a Filter Conditions File

If the data contains conditions (for example, the @audience attribute is set on some topics as "beginner,") Content Delivery can allow users to filter content based on those conditions, provided you first create a filter conditions file and upload it with the rest of the DITA XML files. You should create a filter conditions file for each language version within the publication that needs personalization.

About this task

Procedure

  1. Copy the ContentDelivery_home/samples/DITA/ProductDefinition.xml file to the directory where the DITA XML files reside.
    You may rename this file to any file name, as long as the extension is .xml. Note the name for when you upload your content, because you must select the filter file.
  2. Edit the feature elements to include each attribute and possible option that you have within your content.
    For example, to add the platform attribute and three possible platforms (Windows, Solaris, and Linux) and the audience attribute and four possible audiences (beginner, developer, admin, and internal), use the following syntax:
    <lc:filter xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    	xmlns:lc="http://contentdelivery.lc.example.com/ContentDelivery/" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
       <features>
      			<feature name="platform" value="Windows"/>
    		  	<feature name="platform" value="Solaris"/>
      			<feature name="platform" value="Linux"/>  
      			<feature name="audience" value="beginner"/>
      			<feature name="audience" value="developer"/>
      			<feature name="audience" value="admin"/>
      			<feature name="audience" value="internal"/>
    	  </features>
    </lc:filter>
    http://contentdelivery.lc.example.com/ContentDelivery/ where lc refers to an example related to Content Delivery, and contentdelivery specifies it further as a delivery server
    Do not change the syntax of the first four lines and the last line. The values are case-sensitive, so ensure that they match the case used in the publication XML.