User Guide
Also available as:
PDF

XPath-Based Anonymization Rules

XPath-based rules anonymize XML data using XPath.

Required and Optional Fields

  • name

  • description (optional)

  • rule_id (should be set to XPATH)

  • paths

  • include_files

  • exclude_files (optional)

  • action (optional, default value is ANONYMIZE)

  • replace_value (optional, applicable only when action=REPLACE)

  • shared (optional, default value is true)

  • enabled (optional, default value is true)

For more information on each field, refer to Fields Used for Defining Anonymization Rules.

Rule Definition Example

  {
    "name": "XPATH_RULE",
    "rule_id": "XPATH",
    "paths": ["/data/record[1]/value"],
    "include_files": ["*test_config.xml"],
    "shared": true
  }

Sample Input XML Data

<data>
    <record>
        <name>password</name>
        <value>valueToAnonymize</value>
    </record>
    <record>
        <name>name</name>
        <value>value</value>
    </record>
</data>

Sample Output XML Data (After Anonymization)

<data>
    <record>
        <name>password</name>
        <value>¶smfz923swc¶</value>
    </record>
    <record>
        <name>name</name>
        <value>value</value>
    </record>
</data>

For more examples, refer to Examples of XPath-Based Anonymization Rules.

You can use this reference documentation for XPath.