• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Learning DITA

Free DITA training

Free DITA training

  • Log in
  • Register
  • Newsletter
  • Profile
  • Privacy
  • Home
  • About
  • Courses
  • News
  • Resources
  • Support the site
  • Contact
  • Recordings

What can you filter?

Posted on 12.02.16

Advanced reuse in DITA Lesson 1: Using conditions What can you filter?
Lesson Progress
0% Complete

The DITA filtering mechanism is quite powerful and flexible. You can use it to filter out almost any type of element in DITA topics and in DITA maps.

In DITA topics, some of the elements you can filter are:

  • sections
  • paragraphs
  • ordered and bulleted lists
  • list items
  • notes
  • tables
  • table rows
  • figures
  • images
In DITA maps and bookmaps, some of the elements you can filter are:

  • topic references
  • map references
  • key definitions
  • chapters and appendixes
  • frontmatter, backmatter, and their elements

Where to be careful

There are two areas where you need to exercise some caution in filtering: inline elements and elements that have required children.

It is not a good idea to filter inline elements. This is mostly a localization concern. The previous course (Introduction to reuse in DITA) covered this to some degree: what makes sense in one language when it is filtered out might not make sense (or translate well) when it is presented in another language.

You need to be careful when filtering elements that have required children, otherwise this might result in an invalid structure. If filtering removes required elements, it will result in an invalid topic. For example, if you add conditional attributes to all <li> elements in an unordered list (<ul>) and filtering removes them all, the empty <ul> element will be invalid. Other elements that have required children include <ol>, <sl>, <steps>, <substeps>, <properties>, <table>, <simpletable>. If you are not sure which child elements are required, check the DITA 1.2 specification.

What you cannot filter

There are a number of elements that cannot be filtered out. These include:

  • topic titles
  • individual table <entry> elements
  • step command (<cmd>) elements
  • choicetable entries
Contributors
  • Simon Bate
  • Jake Campbell
  • Gretyl Kinsey
Previous Topic
Back to Lesson
Next Topic

sidebar

Blog Sidebar

  • Scriptorium logo
    Maximize the value of your content. Read more.
  • Scriptorium logo
    Need DITA help? We offer flat-rate consulting. Get help.
  • Scriptorium logo
    Already in DITA and need support? Contact us.
RSSTwitter

Want to add content? Join the ditatraining GitHub repository.

  • Home
  • Sponsor
  • News
  • Contact
  • Privacy

Maintained by Scriptorium Publishing

Logo and site presentation © 2015-2021 Scriptorium Publishing. Content based on the open-source DITA training project.