I have a XML string in one my java String objects as below:
<Record><op>Add</op><sensdata>400188711111</sensdata><id>4</id><a1>1111201090467034</a1></Record>
I need to get the data between sensdata tag and mask it something like 4001887XXXXX and prepare the xml string as below and log it.
<Record><op>Add</op><sensdata>4001887XXXXX</sensdata><id>4</id><a1>1111201090467034</a1></Record>
sensdata tag can be in lower or upper.
What is the better way to do it? Do i have to use some String operations or Regex or XML parser to do it?
I have a small query attached to this question. If i need the data between
<Record> </Record>
i.e
<op>Add</op><sensdata>4001887XXXXX</sensdata><id>4</id><a1>1111201090467034</a1>
Can i get using the xml parser. I am able to get the values like Add4001887XXXXX41111201090467034. But not with tags.