XML Masker Rules
Published 06 January 2020
The XML Masker Rule is designed to find and substitute text within XML-formatted columns.
Note: Your XML Data does not necessarily have to be stored in a column with a datatype of XML. As long as the column contains valid XML structure, Data Masker will be able to mask the column correctly.
Given a table that contains XML data, Data Masker can replace data within that XML.
- Create a new XML rule
- Select the column you want to mask from the list in the left pane.
- In the XPath tab, set the wildcard element name to that of the element(s) that you'd like to mask e.g. FirstName.
- In the Dataset tab, set the dataset to the dataset that you would like to mask the columns with e.g. Names, First Names, Male + Female
The result should look like the following:
Elements to be masked can be targeted in two ways:
Wildcard element name
This matches any element in the XML that has the element name specified, regardless of the level of nesting. If one were to input Name in the example below, the items in bold would be masked.
Full XPath specification
You can also target elements using their full XPath, in the format /ns:Parent/ns:Name. Other values for name which are not on this path will not be masked
In addition to the above, you can choose to update the value of the XML element targeted, or alternatively you can choose to update an attribute of the XML element targeted.
Each dataset provides a set of options that are specific to that dataset to allow for "fine-tuning" of the data used in substitutions.
Data Masker's predefined datasets support a number of common concepts but it is possible to define your own dataset if you need something more specific.
By default, the datasets are located in a directory named Datasets immediately below the Data Masker installation directory and can be changed on the Misc. Setup Tab.
Didn't find what you were looking for?
- Visit the Redgate forum
- Contact Support