Double buffering partial response writer
to take care if embedded CDATA blocks in update delete etc...
According to the spec 18.104.22.168 Writing The Partial Response
implementations have to take care to handle nested cdata blocks properly
This means we cannot allow nested CDATA
according to the xml spec http://www.w3.org/TR/REC-xml/#sec-cdata-sect
everything within a CDATA block is unparsed except for ]]>
Now we have following problem, that CDATA inserts can happen everywhere
not only within the CDATA instructions.
What we have to do now is to double buffer CDATA blocks until their end
and also!!! parse their content for CDATA embedding and replace it with an escaped end sequence.
Now parsing CDATA embedding is a little bit problematic in case of PPR because
Because he/she is not aware that we wrap the entire content into CDATA.
Simply encoding and decoding of the CDATA is similarly problematic
because the browser then chokes on embedded // sections
What we do for now is to simply remove //
and replace all other pending cdatas with their cdata escapes
]]> becomes <![CDATA]]]><![CDATA[>
If this causes problems in corner cases we also can add a second encoding step in
For now I will only implement this in the impl, due to the spec stating
that implementations are responsible of the correct CDATA handling!