Example: How hierarchies defined in a subject scheme map affect filtering

This section is non-normative.

This scenario demonstrates how a processor evaluates attribute values when it performs conditional processing for an attribute that is bound to a set of controlled values.

Example

This section is non-normative.

A company defines a subject category for "Operating system", with a key set to os. There are sub-categories for Linux, Windows, and z/OS, as well as specific Linux variants: Red Hat Linux and SuSE Linux. The company then binds the values that are enumerated in the "Operating system" category to the @platform attribute:

<subjectScheme>
    <subjectdef keys="os">
        <topicmeta>
            <navtitle>Operating systems</navtitle>
        </topicmeta>
        <subjectdef keys="linux">
            <topicmeta>
                <navtitle>Linux</navtitle>
            </topicmeta>
            <subjectdef keys="redhat">
                <topicmeta>
                    <navtitle>RedHat Linux</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="suse">
                <topicmeta>
                    <navtitle>SuSE Linux</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="windows">
            <topicmeta>
                <navtitle>Windows</navtitle>
            </topicmeta>
        </subjectdef>
        <subjectdef keys="zos">
            <topicmeta>
                <navtitle>z/OS</navtitle>
            </topicmeta>
        </subjectdef>
    </subjectdef>
    <enumerationdef>
        <attributedef name="platform"/>
        <subjectdef keyref="os"/>
    </enumerationdef>
</subjectScheme>

The enumeration limits valid values for the @platform attribute to the following: linux, redhat, suse, windows, and zos. If any other values are encountered, processors validating against the scheme will issue a warning.

The following table illustrates how filtering and flagging operate when the above map is processed by a processor. The first two columns provide the values specified in the DITAVAL file. The third and fourth columns indicate the results of the filtering or flagging operation.

att="platform" val="linux" att="platform" val="redhat" How platform="redhat" is evaluated How platform="linux" is evaluated
action="exclude" action="exclude" Excluded. Excluded.
action="include" or action="flag" Excluded. This is an error condition, because if all linux content is excluded, redhat also is excluded. Applications can recover by generating an error message. Excluded.
Unspecified Excluded, because redhat is a kind of linux, and linux is excluded. Excluded.
action="include" action="exclude" Excluded, because all redhat content is excluded. Included.
action="include" Included. Included.
action="flag" Included and flagged with the redhat flag. Included.
Unspecified Included, because all linux content is included. Included.
action="flag" action="exclude" Excluded, because all redhat content is excluded. Included and flagged with the linux flag.
action="include" Included and flagged with the linux flag, because linux is flagged and redhat is a type of linux. Included and flagged with the linux flag.
action="flag" Included and flagged with the redhat flag, because a flag is available that is specifically for redhat. Included and flagged with the linux flag.
Unspecified Included and flagged with the linux flag, because linux is flagged and redhat is a type of linux Included and flagged with the linux flag.
Unspecified action="exclude" Excluded, because all redhat content is excluded If the default value for @platform set in the DITAVAL is "include", this is included. If the default value for @platform set in the DITAVAL is "exclude", this is excluded.
action="include" Included. Included, because all redhat content is included, and general Linux content also applies to RedHat
action="flag" Included and flagged with the redhat flag. Included, because all redhat content is included, and general Linux content also applies to RedHat
Unspecified If the default value for @platform set in the DITAVAL is "include", this is included. If the default value for @platform set in the DITAVAL is "exclude", this is excluded. If the default value for @platform set in the DITAVAL is "include", this is included. If the default value for @platform set in the DITAVAL is "exclude", this is excluded.