You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A CDATA section cannot contain the string "]]>" and therefore it is not possible for a CDATA section to contain nested CDATA sections. The preferred approach to using CDATA sections for encoding text that contains the triad "]]>" is to use multiple CDATA sections by splitting each occurrence of the triad just before the ">". For example, to encode "]]>" one would write: <![CDATA[]]]]><![CDATA[>]]>
This means that to encode "]]>" in the middle of a CDATA section, replace all occurrences of "]]>" with the following: ]]]]><![CDATA[>
This effectively stops and restarts the CDATA section.
It looks like we're not doing this in scala.xml, e.g.
val top =
"""<?xml version="1.0" encoding="UTF-8"?>
|<GRAND
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="2.0">
| <Foo><![CDATA[%s]]></Foo>
|</GRAND>""".stripMargin
println(PCData(top).toString)
according to https://en.wikipedia.org/wiki/CDATA#Nesting
It looks like we're not doing this in
scala.xml
, e.g.gives
The text was updated successfully, but these errors were encountered: