XPath Expression Syntax for Column Definitions

You can specify XPath expressions to display element or attribute data in a column in a custom presentation.

In addition to the list of repository properties you can select from in the Configure Column dialog, you can select xpathExpressions, then enter Xpath expression syntax in the Parameter field to display element content or attribute values in a view.

Example: Displaying Contents of the Title Element in a Details View

Suppose you want to display the text of the title element in a list of DITA topics in a Details view of all topics in a folder.
  1. Select the folder of interest. The Details view displays a list of folder items.
  2. Click in the view toolbar. The Configure Presentation dialog appears.
  3. Click Add Column. The Configure Column dialog appears.
  4. Scroll to the bottom of the Properties list and select xpathExpressions.
  5. Replace the Display Name value with title.
  6. In the Parameter field, enter */title.
  7. Click OK.
  8. Adjust the column orders if desired, using the Move Up and Move Down buttons.
  9. Click OK.

The Details view now displays the topic titles in the title column.

Example: Displaying an Element Attribute Value in Search Results

For example, suppose you want to run a Basic Search for DITA note elements and display the element content and the type attribute for each in the search results.

  1. Run the Basic Search and specify:
    • Find: Elements
    • By: Name
    • Operator: Is
    • Value: note
  2. When the search returns the list of note elements, click in the view toolbar. The Configure Presentation dialog appears.
  3. Click Add Column. The Configure Column dialog appears.
  4. In the Properties list, select Description.
  5. In the Default Width, field enter 300.
  6. Click OK.
  7. Click Add Column.
  8. Scroll to the bottom of the properties list and select xpathExpressions.
  9. Replace the Display Name value with type.
  10. In the Parameter field, enter @type.
  11. Click OK.
  12. Adjust the column orders if desired, using the Move Up and Move Down buttons.
  13. Click OK.

The Details view for the search now displays the first characters of the note element content in the Description column, and the note type attribute in the type column.