To set up a new filter, create an XML document using the schema ‘filter.xsd’.
Filters consist of a title, optional lists of excluded and inherited filters, and a list of elements. Each element specifies a particular tag and, optionally, a map of attribute keys and values.
Here is a sample filter definition:
<?xml version="1.0" encoding="UTF-8"?> <filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd"> <title>WordprocessingML</title> <element>urn:schemas-microsoft-com:office:office:DocumentProperties</element> <element>urn:schemas-microsoft-com:office:office:CustomDocumentProperties</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:binData</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:delText</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:docPr</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:fldData</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:fonts</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:instrText</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:lists</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:shapeDefaults</element> <element>http://schemas.microsoft.com/office/word/2003/wordml:styles</element> </filter>
Filter processing is namespace aware (hence the long element names).