How to Mask XML Element Attributes using Fast Data Masker

book

Article ID: 210114

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

We are trying to mask XML elements using Fast Data Masker. However, while working with the FDM tool, we noticed the tool is fetching single XPATH elements, and we have elements that have multiple attributes that we would like to mask. Such as /ClinicalDocument/recordTarget/patientRole/telecom, which has two telephone numbers, and one email address. Is this supported by FDM, and if so how do we define such XPATHs in config file?

For example:

<telecom use="HP" value="tel:+1-844-822-0000" />
<telecom use="MC" value="tel:+1-844-822-0000" />
<telecom value="mailto:[email protected]" />

Cause

You're correct, when configuring FDM to connect to the XML file you wish to use as the Source for your masking, the FDM UI only displays the various XML elements that are contained in the file.  In order to mask attributes, you'll need to modify the XPATH of the element and add the attribute you wish to mask. 

Environment

Release : 4.8+

Component : CA Test Data Manager - Fast Data Masker

Resolution

To keep my examples simple, I broke out each of the elements 'birthtime' and 'telecom' individually, hoping this would make it a bit easier to follow along.

Starting with the element 'birthtime', since it's much simpler and contains only a single attribute. To modify the value of 'bithtime' attribute value, you must modify the XPATH path by adding /@vaule to the end.

For example: In FDM we see the following Element for 'birthtime'.

To change the masking to point to the attribute value, you must add /@value to the end of the element, by typing this in the 'Add XPATH to mask' field, making it, for example: /ClinicalDocument/recordTarget/patientRole/patient/birthTime/@value.



Then click the 'Add' button to add the tab to the Masking tab.

In my example, I chose to use the DOB masking algorithm to mask the 'birthtime' attribute value, changing the value +/- 2 days

When I run the masking job, I see the 'birthime' value has been masked within the 2 day value set by the masking algorithm.


Original XML file:                                                                                                           Masked XML file:

     
 
 
 
To mask the 'telecom' attributes, we would use the same method, by selecting the 'telecom' element and modify the path to select the attribute to mask. For example, if you which to mask the 'use' attribute, the XPATH path would need to be /ClinicalDocument/recordTarget/patientRole/telecom/@use. Likewise, if you want to mask the 'value' attribute, the XPATH path would need to be /ClinicalDocument/recordTarget/patientRole/telecom/@value

   

Resulting in the following masking: