Hi All,
Could someone please help me figure out how I can extract from my xml the CData part, which is also an xml. Once I have the CData xml, I will then apply some xslt script on it and then embed the processed xml back in the CData area.
For example:
I would like to extract the
<CreditCardNumber>123456123</CreditCardNumber>
, process it with my xslt script and then embed it back in the original xml, e.g. my desired out:
The masking
<CreditCardNumber>*******23</CreditCardNumber>
above is done by my xslt script.
What I need to know is how I can extract the CData part and embedd it back.
Second important thing is that the structure of my input xml is not fix. The input xml could vary in structure, i.e. it might or might not have CData, incase if the CData is not there, the xslt script should simply be applied and masking is performed if required. The masking logic is handled entirely in the xslt script. But in-case, if the CData is present, then the extraction->xslt script->embed logic is applied.
A pure xslt based solution is not feseable, but some
java and xslt solution.
So in short, I am looking for a kind osolution as to how I can check if CData is present, and if yes, extract its contents, then xslt and then embedding it back in the original xml.
Thanks.