XML masking is failing when there is a default namespace in the xml content
search cancel

XML masking is failing when there is a default namespace in the xml content

book

Article ID: 218743

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

We noticed  below error while running the masking. This is due to default namespace (xmlns) used by xml content is: xmlns="http://guidewire.com/gx/xx.xx.xx.structure.MarketMessageModel". FDM is not allowing to change the default namespace to other paths during masking.   

Tested the same in Portal  and see the same error. 

      When I remove this namespace from xml content, we are able to mask correctly.

    I tried using XPATHNAMESPACEMAP option to replace default namespace. But it is not allowing to modify.

 

ERROR:

  2021-05-13 07:17:48.449 java.lang.IllegalArgumentException: The default (no prefix) Namespace URI for XPath queries is always '' and it cannot be redefined to 'http://guidewire.com/gx/qbeeo.cc.messages.structure.MarketMessageModel'.
 at org.jdom2.xpath.util.AbstractXPathCompiled.<init>(AbstractXPathCompiled.java:144)
 at org.jdom2.xpath.jaxen.JaxenCompiled.<init>(JaxenCompiled.java:148)
 at org.jdom2.xpath.jaxen.JaxenXPathFactory.compile(JaxenXPathFactory.java:82)
 at org.jdom2.xpath.XPathFactory.compile(XPathFactory.java:261)
 at com.grid_tools.products.datamasker.genfunctions.processXML(genfunctions.java:1257)
 at com.grid_tools.products.datamasker.Datamasker.resolveFunction(Datamasker.java:15057)
 at com.grid_tools.products.datamasker.SQLUpdate.batchPreparedMasking(SQLUpdate.java:4170)

Environment

Release : 4.8, 4.9

Component : CA Test Data Manager - Others

Resolution

Please use the latest TDM patch TDMWeb-4.10.216.0 or newer and follow below steps to resolve the issue:

In Options file:

XMLNAMESPACEAWARE=Y

XPATHNAMESPACEMAP=mm=http://guidewire.com/gx/xx.xx.xx.structure.MarketMessageModel

 

In CSV file for Xpath:

/mm:MarketMessage/mm:Claim/mm:BureauClaimNumber_Ext

 

For Portal Masking: 

Add the options as below:

And for the Masking configuration, if using XMLREPLACE Function ;  define the Xpath  as      /mm:IndividualSurvey/mm:BirthDate

 

Latest patch available from: TDM Support Patches