Reputation: 1345
i want to use CDATA within CDATA in XML i tried following codes, but both are showing error.
1.
<extraScript><![CDATA[
<subScript><![CDATA[this.value]]></subScript>
]]></extraScript>
2.
<extraScript><![CDATA[
<subScript><![CDATA[this.value]]]]><![CDATA[></subScript>
]]></extraScript>
i refereed this post in SO
according to that answer i tried second one but </subScript>
is making problem how i can escape these part. some helps??
Upvotes: 0
Views: 857
Reputation: 944256
You can't nest CDATA blocks.
The first ]]>
will terminate the first CDATA block and then the next end tag will not be well-formed.
Use character references (<
et al) instead.
Upvotes: 4