CDATA

Hi,

Requirment is to take data under CDATA.
In CDATA ,data format is

CDATA[
	<?xml version="1.0"?>

<ROCKWELL_CANDIDATE>
2017323
2530BR

I am facing problem in removing “<?xml version="1.0"?>” from CDATA section.I am getting data under CDATA section after XSLT transformation,and XSLT transformation automatically write <?xml version="1.0"?> in output file.So after XSLT transformation,i am getting
file in format as:

<?xml version="1.0" encoding="UTF-8"?>
	<?xml version="1.0"?>

<ROCKWELL_CANDIDATE>
2017323

my desired output is

<?xml version="1.0" encoding="UTF-8"?>

<ROCKWELL_CANDIDATE>
2017323

Please help me in solving.

Thanx

Using the variable $cd to represent your CDATA string, you could use:

substring-after($cd, ' <?xml version="1.0"?>')

In general, though, I would say the use of CDATA like this represents a pathology somewhere in the application. (I realize you may have no control over the application generating this.)

<xsl:output omit-xml-declaration=“yes”/>

Put this after the stylesheet element.