<nav class="toc" role="toc"><ul><li><a href="../../introduction/dita-release-overview.html">Introduction</a></li><li><a href="../../archSpec/base/dita-terminology.html">DITA terminology, notation, and conventions</a></li><li><a href="../../archSpec/base/introduction-to-dita.html">Overview of DITA</a></li><li><a href="../../archSpec/base/accessibility-and-translation.html">Accessibility and translation</a></li><li><a href="../../archSpec/base/dita-map-processing.html">DITA map processing</a></li><li><a href="../../archSpec/base/ditaaddressing.html">DITA addressing</a></li><li><a href="../../archSpec/base/behaviors.html">DITA processing</a><ul class="nav nav-list"><li><a href="../../archSpec/base/navigation.html">Navigation</a></li><li><a href="../../archSpec/base/indexes.html">Indexes</a></li><li><a href="../../archSpec/base/conref.html">Content reference (conref)</a></li><li><a href="../../archSpec/base/condproc.html">Conditional processing</a><ul class="nav nav-list"><li><a href="../../archSpec/base/aboutconditionalprocessing.html">About conditional processing</a></li><li><a href="../../archSpec/base/conditionalprocessingexpectations.html">Expectations for conditional processing</a></li><li><a href="../../archSpec/base/aboutditavaldocuments.html">About the DITAVAL document</a></li><li><a href="../../archSpec/base/usage-of-conditional-processing-attributes.html">Conditional processing attribute values</a></li><li><a href="../../archSpec/base/usage-of-conditional-processing-attribute-groups.html">Conditional processing attribute values with groups</a></li><li><a href="../../archSpec/base/conditional-processing-and-subject-schemes.html">Conditional processing and subject schemes</a></li><li class="active"><a href="../../archSpec/base/filtering.html">Filtering based on metadata attributes</a></li><li><a href="../../archSpec/base/flagging.html">Flagging based on metadata attributes</a></li><li><a href="../../archSpec/base/examples-of-conditional-processing.html">Examples of conditional processing</a></li></ul></li><li><a href="../../archSpec/base/branch-filtering.html">Branch filtering</a></li><li><a href="../../archSpec/base/sort-as-processing.html">Sorting</a></li><li><a href="../../archSpec/base/determining-effective-attribute-values.html">Determining effective attribute values</a></li></ul></li><li><a href="../../archSpec/base/configuration-specialization-and-constraints.html">Configuration and specialization </a></li><li><a href="../../langRef/langRef-base.html">Element reference</a></li><li><a href="../../conformance/conformance.html">Conformance</a></li><li><a href="../../acknowledgments/acknowledgments.html">Acknowledgments</a></li><li><a href="../../non-normative/aggregated-RFC-2119-statements.html">Aggregated RFC-2119 statements</a></li><li><a href="../../archSpec/base/coding-requirements.html">Coding practices for DITA grammar files</a></li><li><a href="../../non-normative/developing-constraint-and-expansion-modules.html">Constraint modules</a></li><li><a href="../../non-normative/expansion-modules.html">Expansion modules</a></li><li><a href="../../non-normative/elementsMerged.html">Element-by-element recommendations for translators</a></li><li><a href="../../non-normative/formatting-expectations.html">Formatting expectations</a></li><li><a href="../../non-normative/migrating-to-dita-2.0.html">Migrating to DITA 2.0</a></li><li><a href="../../non-normative/basedoctypes.html">OASIS grammar files</a></li><li><a href="../../non-normative/interoperability-considerations.html">Processing interoperability considerations</a></li><li><a href="../../non-normative/revision-history.html">Revision history</a></li></ul></nav><main role="main" class=""><article role="article" aria-labelledby="ariaid-title1"> <h1 class="title topictitle1" id="ariaid-title1">Filtering based on metadata attributes</h1> <div class="body conbody"><p class="shortdesc">When rendering content, a conditional processing profile can be used to specify whether an element's content is filtered based on its conditional processing attributes.</p> <p class="p">To determine whether content is filtered, a processor compares the conditional processing attributes on a DITA element to rules specified in a conditional processing profile. If any one of the conditional processing attributes evaluates as <span class="keyword">exclude</span>, that content is filtered.</p> <p class="p">Within a DITAVAL document, it is possible to specify a default action for conditional processing attributes. When no default is specified, the processing default for any attribute or value not otherwise listed is <span class="keyword">include</span>. <span class="ph example">For example, if no default action is provided for <code class="keyword markupname xmlatt">@audience</code> and the value <span class="keyword">novice</span> for that attribute is not defined, that attribute value will have a processing default of <span class="keyword">include</span>.</span></p> <p class="p">When deciding whether to include or exclude a particular element, a processor evaluates each attribute independently:</p> <ol class="ol"> <li class="li">For each attribute:<ul class="ul"> <li class="li">If the attribute is empty, or contains only empty groups, it is equivalent to omitting the attribute from the element. If evaluated for the purposes of filtering, the attribute is treated as "include", because an omitted attribute cannot evaluate to "exclude".</li> <li class="li">If the attribute value does not contain any groups, then if any string token in the attribute value evaluates to <span class="keyword">include</span>, the element evaluates to <span class="keyword">include</span>. In other words, the attribute evaluates to <span class="keyword">exclude</span> only when <strong class="ph b">all</strong> string tokens in that attribute evaluate to <span class="keyword">exclude</span>.</li> <li class="li">If the attribute value does include groups, evaluate as follows, treating ungrouped tokens together as an implicit group:<ol class="ol" type="a"> <li class="li">For each group (including any implicit group), if any string token inside the group evaluates to <span class="keyword">include</span>, the group evaluates to <span class="keyword">include</span>. In other words, a group evaluates to <span class="keyword">exclude</span> only when <strong class="ph b">all</strong> string tokens in that group evaluate to <span class="keyword">exclude</span>.</li> <li class="li">If any group within an attribute evaluates to <span class="keyword">exclude</span>, that attribute evaluates to <span class="keyword">exclude</span>. In other words, the attribute evaluates to <span class="keyword">include</span> only when <strong class="ph b">all</strong> groups in that attribute evaluate to <span class="keyword">include</span>.</li> </ol></li> </ul></li> <li class="li">If <strong class="ph b">any single attribute</strong> evaluates to <span class="keyword">exclude</span>, the element is filtered.</li> </ol> <p class="p">For example, if a paragraph applies to three products and the publisher has chosen to exclude all of them, the processor will exclude the paragraph. This is true even if the paragraph applies to an audience or platform that is not excluded. But if the paragraph applies to an additional product that has not been excluded, then its content is still relevant for the intended output and is preserved.</p> </div> <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../../archSpec/base/condproc.html" title="Conditional processing is the filtering or flagging of information based on processing-time criteria. Conditional processing is based on attributes specified in the DITA source.">Conditional processing</a></div></div><div class="linklist relref"><strong>Related reference</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../../langRef/attributes/universalAttributes.html" title="The universal attribute group defines a set of common attributes that are available on almost every DITA element. The universal attribute group includes all attributes from the ID, localization, and metadata attribute groups, plus the class and outputclass attributes.">Metadata attributes</a></li><li class="linklist"><a class="link" href="../../langRef/ditaval/val.html" title="The val element is the root element of a DITAVAL document.">DITAVAL markup with extended filtering example</a></li></ul></div></nav><aside class="section-toc" role="aside"></aside></article></main>