Below is the xml that has CDATA section
Indiana Jones
First, the fact that your input XML has "CDATA" is in one sense irrelevant... the XSLT can't tell whether it's CDATA or not. What's key about your input XML is that you have escaped markup
, and you want to turn it into a real element.
If you know that the escaped element will always have a certain name ('film'), and you know where it occurs, you can strip it and replace it easily:
If you don't know in advance where the escaped tags will occur and what the element names are, you could use XSLT 2.0's
to find and replace them. But as Alejandro pointed out, general parsing of XML using regular expressions can get very messy. It would only be feasible if you know the markup will be simple.