I have a xml fragment like below
<Detail uid="6">
<![CDATA[
<div class="heading">welcome to my page</div>
<div class="paragraph">this is paraph</div>
]]>
</Detail>
and I want to be able to change the
<div class="heading">...</div> to <h1>Welcome to my page</h1>
<div class="paragraph">...</div> to <p>this is paragraph</p>
do you know how I can do that in xslt 1.0
You can't "remove" the CDATA, but you can achieve the desired output somewhat crudely:
This will work for the first type of div you're trying to parse and you can follow something similar with the second one. It could be made more generic with some effort.
You cannot tell XSL 1.0 to fish a string out of a CDATA and parse it as XML.
What about running two transforms.
Pass 1.)
Will produce:
Pass 2.)
Produces: