#### 9.6.1 Understanding the advantages of filtering in maps

Filtering on <topicref> elements in a map instead of on attributes in a topic can help keep topics reusable, by not cluttering them with attributes that must work correctly in all maps in which those topics will ever be referenced. Filtering on attributes in topics can be a problem for another reason: if a <topicref> pulls in a topic, and you then filter out the content of that topic, you are left with something that might not be valid.

Same content for multiple outputs in same map

Suppose a topic includes information common to more than one product (for example), with no variations in content by product. And suppose two or more products are included in the map that references this topic. You must make sure the cross references from other topics reference the correct instance of the topic for each product. You cannot just reference one instance, because then you lose parent/child and previous/next relationships that include the common topic.

Varying content for multiple outputs in same map

Suppose the topic information varies to some degree for each product. That means the topic must be filtered by a different ditaval file for each instance. DITA2Go accomplishes this by adding a ditaval attribute to a PI that identifies the variant.

Previous Topic: 9.6 Scoping and filtering within maps

Next Topic: 9.6.2 Designating map sections as named branches

Parent Topic: 9.6 Scoping and filtering within maps

Sibling Topics:

9.6.2 Designating map sections as named branches

9.6.3 Reusing the same topics with different conditions

9.6.4 Directing a cross reference to the correct branch

9.6.5 Directing a content reference to the correct branch

9.6.6 Limiting the scope of keydefs by branch

9.6.7 Directing a key reference to the correct branch

Table of Contents • Index