过滤内容

You can set to exclude content based on its metadata. By default, all content is included.

All the values in at least one attribute must be set to exclude for an element to be filtered out.
  1. Create a DITA filter file in the directory you want to add the file to. Give the file a descriptive name, such as "audience-flag-build.ditaval".
  2. Open the file, and type below content into it:
    <?xml version="1.0" encoding="UTF-8"?> 
    <val> </val>
  3. Define the property you want to exclude:
    1. Find the attribute name. Type a new property for exclude by adding a new line <prop att="" val="" action="exclude"/>.
    2. Select the attribute ("audience", "platform", "product", "otherprops") you want to exclude based on. For example, "audience".
    3. Type the value you want to exclude. For example, "programmer".
    You can define more properties by following the steps above. The final ditaval file with the example values should be like this:
    <?xml version="1.0" encoding="UTF-8"?> 
    <val>
      <prop att="audience" val="programmer" action="exclude"/>
    </val>
  4. When you publish output from the topic or map, specify the filter file you want by using the parameter /filter:{args.input.valfile} for the output options.
Content is excluded only when all the values in a single attribute are set to exclude. For example, if you have a list item that applies to programmer and administrator audiences, and you exclude programmers, the list item will remain in the output because it still applies to administrators.