Specifying an Attribute Value for an Included or Excluded Element
- Last Updated: April 15, 2026
- 1 minute read
- MarkLogic Server
- Version 11.0
- Documentation
When you include an element, one of the options is to specify an attribute value. This option allows you to only include or exclude elements with a particular attribute/value pair. The attribute/value pair acts as a predicate on which to constrain the content. For example, consider the following XML snippet:
<chapter class="history">some text here</chapter>
<chapter class="mathematics">some more text here</chapter>
<chapter class="english">some other text here</chapter>
<chapter class="history">some different text here</chapter>
<chapter class="french">other text here</chapter>
<chapter class="linguistics">still other text here</chapter>
For the element chapter, if you specify the attribute/value pair of class and history, then only the following elements will be included:
<chapter class="history">some text here</chapter>
<chapter class="history">some different text here</chapter>
Similarly, you can specify an attribute value for an excluded element when you configure an excluded element.